mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
Add a speed test
This commit is contained in:
parent
6c4bc3f3f3
commit
6dff1aa9fc
2 changed files with 22 additions and 2 deletions
20
spec/speed.rb
Normal file
20
spec/speed.rb
Normal 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
|
|
@ -66,11 +66,11 @@ module LogStash
|
||||||
config_str = @config_str
|
config_str = @config_str
|
||||||
describe "agent(#{@agent_count}) #{caller[1]}" do
|
describe "agent(#{@agent_count}) #{caller[1]}" do
|
||||||
before :all do
|
before :all do
|
||||||
start = Time.now
|
start = ::Time.now
|
||||||
@agent = LogStash::Agent.new
|
@agent = LogStash::Agent.new
|
||||||
@agent.run(["-e", config_str])
|
@agent.run(["-e", config_str])
|
||||||
@agent.wait
|
@agent.wait
|
||||||
@duration = Time.now - start
|
@duration = ::Time.now - start
|
||||||
end
|
end
|
||||||
it("looks good", &block)
|
it("looks good", &block)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue