Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions lib/logstash/filters/metrics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,34 @@
# The event that is flushed will include every 'meter' and 'timer'
# metric in the following way:
#
# #### 'meter' values
# ==== 'meter' values
#
# For a `meter => "something"` you will receive the following fields:
#
# * "thing.count" - the total count of events
# * "thing.rate_1m" - the 1-minute rate (sliding)
# * "thing.rate_5m" - the 5-minute rate (sliding)
# * "thing.rate_15m" - the 15-minute rate (sliding)
# * `thing.count` - the total count of events
# * `thing.rate_1m` - the 1-minute rate (sliding)
# * `thing.rate_5m` - the 5-minute rate (sliding)
# * `thing.rate_15m` - the 15-minute rate (sliding)
#
# #### 'timer' values
# ==== 'timer' values
#
# For a `timer => [ "thing", "%{duration}" ]` you will receive the following fields:
# For a `timer => { "thing" => "%{duration}" }` you will receive the following fields:
#
# * "thing.count" - the total count of events
# * "thing.rate_1m" - the 1-minute rate of events (sliding)
# * "thing.rate_5m" - the 5-minute rate of events (sliding)
# * "thing.rate_15m" - the 15-minute rate of events (sliding)
# * "thing.min" - the minimum value seen for this metric
# * "thing.max" - the maximum value seen for this metric
# * "thing.stddev" - the standard deviation for this metric
# * "thing.mean" - the mean for this metric
# * "thing.pXX" - the XXth percentile for this metric (see `percentiles`)
# * `thing.count` - the total count of events
# * `thing.rate_1m` - the 1-minute rate of events (sliding)
# * `thing.rate_5m` - the 5-minute rate of events (sliding)
# * `thing.rate_15m` - the 15-minute rate of events (sliding)
# * `thing.min` - the minimum value seen for this metric
# * `thing.max` - the maximum value seen for this metric
# * `thing.stddev` - the standard deviation for this metric
# * `thing.mean` - the mean for this metric
# * `thing.pXX` - the XXth percentile for this metric (see `percentiles`)
#
# #### Example: computing event rate
# ==== Example: computing event rate
#
# For a simple example, let's track how many events per second are running
# through logstash:
#
# [source,ruby]
# input {
# generator {
Expand Down Expand Up @@ -81,7 +82,9 @@
# }
# }
#
#
# Running the above:
#
# [source,ruby]
# % bin/logstash -f example.conf
# rate: 23721.983566819246
Expand All @@ -101,11 +104,12 @@
# }
class LogStash::Filters::Metrics < LogStash::Filters::Base
config_name "metrics"
milestone 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I know this is an old PR)

Remove milestone, otherwise LGTM.


# syntax: `meter => [ "name of metric", "name of metric" ]`
# `meter => [ "name of metric", "name of metric" ]`
config :meter, :validate => :array, :default => []

# syntax: `timer => [ "name of metric", "%{time_value}" ]`
# `timer => { "name of metric" => "%{time_value}" }`
config :timer, :validate => :hash, :default => {}

# Don't track events that have @timestamp older than some number of seconds.
Expand Down