diff --git a/spec/speed.rb b/spec/speed.rb new file mode 100644 index 000000000..9f3f13a0b --- /dev/null +++ b/spec/speed.rb @@ -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 diff --git a/spec/test_utils.rb b/spec/test_utils.rb index 42c77d016..480ff1de7 100644 --- a/spec/test_utils.rb +++ b/spec/test_utils.rb @@ -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