Delete unused tools/benchmark folder

Fixes #7831
This commit is contained in:
Suyog Rao 2017-07-27 12:15:07 -07:00
parent b6ad235990
commit fea624a05b
3 changed files with 0 additions and 71 deletions

View file

@ -1,3 +0,0 @@
# encoding: utf-8
require "benchmark/ips"
require "logstash/instrument/collector"

View file

@ -1,17 +0,0 @@
# encoding: utf-8
require "benchmark/ips"
require "logstash/event"
options = { :time => 10, :warmup => 60 }
puts "Same Event instance"
event = LogStash::Event.new("foo" => {"bar" => {"foobar" => "morebar"} })
STDERR.puts ""
STDERR.puts " ----------> event.get(\"[foo][bar][foobar]\") => #{event.get("[foo][bar][foobar]")}"
STDERR.puts ""
Benchmark.ips do |x|
x.config(options)
x.report("Deep fetch") { event.get("[foo][bar][foobar]") }
end

View file

@ -1,51 +0,0 @@
# encoding: utf-8
require "benchmark/ips"
require "lib/logstash/event"
options = { :time => 10, :warmup => 10 }
puts "Same Event instance"
Benchmark.ips do |x|
x.config(options)
event = LogStash::Event.new("foo" => "bar",
"foobar" => "morebar")
x.report("Complex cached: Event#sprintf") { event.sprintf("/first/%{foo}/%{foobar}/%{+YYY-mm-dd}") }
x.report("Date only cached: Event#sprintf") { event.sprintf("%{+YYY-mm-dd}") }
x.report("string only cached: Event#sprintf") { event.sprintf("bleh") }
x.report("key only cached: Event#sprintf") { event.sprintf("%{foo}") }
x.compare!
end
puts "New Event on each iteration"
Benchmark.ips do |x|
x.config(options)
x.report("Complex cached: Event#sprintf") do
event = LogStash::Event.new("foo" => "bar",
"foobar" => "morebar")
event.sprintf("/first/%{foo}/%{foobar}/%{+YYY-mm-dd}")
end
x.report("Date only cached: Event#sprintf") do
event = LogStash::Event.new("foo" => "bar",
"foobar" => "morebar")
event.sprintf("%{+YYY-mm-dd}")
end
x.report("string only cached: Event#sprintf") do
event = LogStash::Event.new("foo" => "bar",
"foobar" => "morebar")
event.sprintf("bleh")
end
x.report("key only cached: Event#sprintf") do
event = LogStash::Event.new("foo" => "bar",
"foobar" => "morebar")
event.sprintf("%{foo}")
end
x.compare!
end