mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
fix broken graphite codec spec
This commit is contained in:
parent
fc0a06ccc7
commit
38f705a2cd
1 changed files with 4 additions and 4 deletions
|
@ -61,7 +61,7 @@ describe LogStash::Codecs::Graphite do
|
|||
insist { event.is_a? String }
|
||||
insist { event } == "#{name} #{value} #{timestamp.to_i}\n"
|
||||
end
|
||||
subject.encode(LogStash::Event.new)
|
||||
subject.encode(LogStash::Event.new("@timestamp" => timestamp))
|
||||
end
|
||||
|
||||
it "should treat fields as metrics if fields as metrics flag is set" do
|
||||
|
@ -73,11 +73,11 @@ describe LogStash::Codecs::Graphite do
|
|||
insist { event.is_a? String }
|
||||
insist { event } == "#{name} #{value} #{timestamp.to_i}\n"
|
||||
end
|
||||
subject.encode(LogStash::Event.new({name => value}))
|
||||
subject.encode(LogStash::Event.new({name => value, "@timestamp" => timestamp}))
|
||||
|
||||
#even if metrics param is set
|
||||
subject.metrics = {"foo" => 4}
|
||||
subject.encode(LogStash::Event.new({name => value}))
|
||||
subject.encode(LogStash::Event.new({name => value, "@timestamp" => timestamp}))
|
||||
end
|
||||
|
||||
it "should change the metric name format when metrics_format is set" do
|
||||
|
@ -90,7 +90,7 @@ describe LogStash::Codecs::Graphite do
|
|||
insist { event.is_a? String }
|
||||
insist { event } == "foo.bar.#{name}.baz #{value} #{timestamp.to_i}\n"
|
||||
end
|
||||
subject.encode(LogStash::Event.new)
|
||||
subject.encode(LogStash::Event.new("@timestamp" => timestamp))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue