Socket
Book a DemoInstallSign in
Socket

fluent-mixin-elapsed_time

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluent-mixin-elapsed_time

bundlerRubygems
Version
0.0.4
Version published
Maintainers
1
Created
Source

fluent-mixin-elapsed_time

Build Status Code Climate

Fluentd mixin to measure elapsed time to process messages

Installation

Use RubyGems:

gem install fluent-mixin-elapsed_time

Run Fluentd with -r option to require this gem. This will automatically extends all input and output plugins (actually, Input and Output base class).

fluentd -c fluent.conf -r 'fluent/mixin/elapsed_time'

Configuration

This mixin module extends arbitrary plugins so that it can use <elapsed></elapsed> directive to measure elapsed times.

Example:

<source>
  type forward
  port 24224
  <elapsed>
    tag elapsed
    interval 60
    hook on_message
  </elapsed>
</source>

<match elapsed>
  type stdout
</match>

This example hooks the on_message method of in_forward plugin, and measures how long it takes for processing.

And, this plugin emits the statistics of measured elapsed times in each specified interval like below:

elapsed: {"max":1.011,"avg":0.002","num":10}

where max and avg are the maximum and average elapsed times, and num is the number of being called in each interval.

Parameters

  • interval

    The time interval to emit measurement results. Default is 60.

  • tag

    The output tag name. Default is elapsed

  • hook (required)

    Specify the method to hook. You can also explicitly specify the class name like Fluent::ForwardOutput.on_message. (EXCUSE: Fluentd treats strings after # as a comment, so the form like Fluent::ForwardInput#on_message could not be used)

ChangeLog

See CHANGELOG.md for details.

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

Copyright (c) 2014 Naotoshi Seo. See LICENSE for details.

FAQs

Package last updated on 10 Apr 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts