make the date perf test smarter

This commit is contained in:
Jordan Sissel 2012-09-12 10:41:38 -07:00
parent dcd534de95
commit a2097a5890

View file

@ -6,8 +6,10 @@ describe LogStash::Filters::Date do
describe "performance test of java syntax parsing" do describe "performance test of java syntax parsing" do
event_count = 50000 event_count = 100000
max_duration = 10 min_rate = 10000
max_duration = event_count / min_rate
input = "Nov 24 01:29:01 -0800" input = "Nov 24 01:29:01 -0800"
config <<-CONFIG config <<-CONFIG
input { input {
@ -22,9 +24,11 @@ describe LogStash::Filters::Date do
mydate => "MMM dd HH:mm:ss Z" mydate => "MMM dd HH:mm:ss Z"
} }
} }
output { null { } }
CONFIG CONFIG
agent do agent do
puts "date parse rate: #{event_count / @duration}"
insist { @duration } < max_duration insist { @duration } < max_duration
end end
end end