Add a speed test

This commit is contained in:
Jordan Sissel 2012-09-11 00:09:34 -07:00
parent 6c4bc3f3f3
commit 6dff1aa9fc
2 changed files with 22 additions and 2 deletions

20
spec/speed.rb Normal file
View file

@ -0,0 +1,20 @@
require "test_utils"
describe "speed tests" do
extend LogStash::RSpec
count = 50000
config <<-CONFIG
input {
generator {
type => foo
count => #{count}
}
}
output { null { } }
CONFIG
agent do
puts "Rate: #{count / @duration}"
end
end

View file

@ -66,11 +66,11 @@ module LogStash
config_str = @config_str
describe "agent(#{@agent_count}) #{caller[1]}" do
before :all do
start = Time.now
start = ::Time.now
@agent = LogStash::Agent.new
@agent.run(["-e", config_str])
@agent.wait
@duration = Time.now - start
@duration = ::Time.now - start
end
it("looks good", &block)
end