mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
added set metric output
This commit is contained in:
parent
279711497a
commit
62f39154b9
1 changed files with 7 additions and 0 deletions
|
@ -52,6 +52,9 @@ class LogStash::Outputs::Statsd < LogStash::Outputs::Base
|
|||
# A count metric. metric_name => count as hash
|
||||
config :count, :validate => :hash, :default => {}
|
||||
|
||||
# A set metric. metric_name => string to append as hash
|
||||
config :set, :validate => :hash, :default => {}
|
||||
|
||||
# The sample rate for the metric
|
||||
config :sample_rate, :validate => :number, :default => 1
|
||||
|
||||
|
@ -90,6 +93,10 @@ class LogStash::Outputs::Statsd < LogStash::Outputs::Base
|
|||
@client.timing(build_stat(event.sprintf(metric), sender),
|
||||
event.sprintf(val).to_f, @sample_rate)
|
||||
end
|
||||
@set.each do |metric, val|
|
||||
@client.set(build_stat(event.sprintf(metric), sender),
|
||||
event.sprintf(val), @sample_rate)
|
||||
end
|
||||
end # def receive
|
||||
|
||||
def build_stat(metric, sender=@sender)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue