From 671579ba8a58b55169c3d1e43b0aef1c06addd4d Mon Sep 17 00:00:00 2001 From: David Phillips Date: Thu, 15 Oct 2015 16:09:50 -0700 Subject: [PATCH 1/6] Added ability to specifiy filter worker threads --- README.md | 8 +++- examples/suite/basic_performance_long.rb | 5 ++- .../basic_performance_long_with_workers.rb | 21 ++++++++++ examples/suite/basic_performance_quick.rb | 5 ++- .../basic_performance_quick_with_workers.rb | 21 ++++++++++ lib/lsperfm/core.rb | 3 +- lib/lsperfm/core/run.rb | 4 +- spec/fixtures/worker_basic_suite.rb | 4 ++ spec/lib/runner_spec.rb | 2 +- spec/lib/suite_spec.rb | 6 +-- spec/lib/worker_suite_spec.rb | 40 +++++++++++++++++++ 11 files changed, 108 insertions(+), 11 deletions(-) create mode 100644 examples/suite/basic_performance_long_with_workers.rb create mode 100644 examples/suite/basic_performance_quick_with_workers.rb create mode 100644 spec/fixtures/worker_basic_suite.rb create mode 100644 spec/lib/worker_suite_spec.rb diff --git a/README.md b/README.md index 0e3efe4..81dad6e 100644 --- a/README.md +++ b/README.md @@ -75,12 +75,16 @@ a suite file defines a series of tests to run. #### suite file format ```ruby +# format description: # each test can be executed by either target duration using :time => N secs # or by number of events with :events => N # +# you can specify the number of filter worker threads for each test with :workers => N +# if you don't specify workers, it defaults to 1 +# #[ # {:name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 30}, -# {:name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, +# {:workers => 2, :name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, #] # [ @@ -88,7 +92,7 @@ a suite file defines a series of tests to run. {:name => "simple line out", :config => "config/simple.conf", :input => "input/simple_10.txt", :time => 60}, {:name => "json codec", :config => "config/json_inout_codec.conf", :input => "input/json_medium.txt", :time => 60}, {:name => "json filter", :config => "config/json_inout_filter.conf", :input => "input/json_medium.txt", :time => 60}, - {:name => "complex syslog", :config => "config/complex_syslog.conf", :input => "input/syslog_acl_10.txt", :time => 60}, + {:workers => 2, :name => "complex syslog", :config => "config/complex_syslog.conf", :input => "input/syslog_acl_10.txt", :time => 60}, ] ``` diff --git a/examples/suite/basic_performance_long.rb b/examples/suite/basic_performance_long.rb index 651f4ca..c315174 100644 --- a/examples/suite/basic_performance_long.rb +++ b/examples/suite/basic_performance_long.rb @@ -2,9 +2,12 @@ # each test can be executed by either target duration using :time => N secs # or by number of events with :events => N # +# you can specify the number of filter worker threads for each test with :workers => N +# if you don't specify workers, it defaults to 1 +# #[ # {:name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 30}, -# {:name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, +# {:workers => 2, :name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, #] # [ diff --git a/examples/suite/basic_performance_long_with_workers.rb b/examples/suite/basic_performance_long_with_workers.rb new file mode 100644 index 0000000..6595d1c --- /dev/null +++ b/examples/suite/basic_performance_long_with_workers.rb @@ -0,0 +1,21 @@ +# format description: +# each test can be executed by either target duration using :time => N secs +# or by number of events with :events => N +# +# you can specify the number of filter worker threads for each test with :workers => N +# if you don't specify workers, it defaults to 1 +# +#[ +# {:name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 30}, +# {:workers => 2, :name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, +#] +# +[ + {:workers => 2, :name => "simple line in/out", :config => "config/simple.conf", :input => "input/simple_10.txt", :time => 120}, + {:workers => 2, :name => "simple line in/json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 120}, + {:workers => 2, :name => "json codec in/out", :config => "config/json_inout_codec.conf", :input => "input/json_medium.txt", :time => 120}, + {:workers => 2, :name => "line in/json filter/json out", :config => "config/json_inout_filter.conf", :input => "input/json_medium.txt", :time => 120}, + {:workers => 2, :name => "apache in/json out", :config => "config/simple.conf", :input => "input/apache_log.txt", :time => 120}, + {:workers => 2, :name => "apache in/grok codec/json out", :config => "config/simple_grok.conf", :input => "input/apache_log.txt", :time => 120}, + {:workers => 2, :name => "syslog in/json out", :config => "config/complex_syslog.conf", :input => "input/syslog_acl_10.txt", :time => 120}, +] diff --git a/examples/suite/basic_performance_quick.rb b/examples/suite/basic_performance_quick.rb index afaf948..8dc5fab 100644 --- a/examples/suite/basic_performance_quick.rb +++ b/examples/suite/basic_performance_quick.rb @@ -2,9 +2,12 @@ # each test can be executed by either target duration using :time => N secs # or by number of events with :events => N # +# you can specify the number of filter worker threads for each test with :workers => N +# if you don't specify workers, it defaults to 1 +# #[ # {:name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 30}, -# {:name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, +# {:workers => 2, :name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, #] # [ diff --git a/examples/suite/basic_performance_quick_with_workers.rb b/examples/suite/basic_performance_quick_with_workers.rb new file mode 100644 index 0000000..091093c --- /dev/null +++ b/examples/suite/basic_performance_quick_with_workers.rb @@ -0,0 +1,21 @@ +# format description: +# each test can be executed by either target duration using :time => N secs +# or by number of events with :events => N +# +# you can specify the number of filter worker threads for each test with :workers => N +# if you don't specify workers, it defaults to 1 +# +#[ +# {:name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 30}, +# {:workers => 2, :name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, +#] +# +[ + {:workers => 2, :name => "simple line in/out", :config => "config/simple.conf", :input => "input/simple_10.txt", :time => 30}, + {:workers => 2, :name => "simple line in/json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 30}, + {:workers => 2, :name => "json codec in/out", :config => "config/json_inout_codec.conf", :input => "input/json_medium.txt", :time => 30}, + {:workers => 2, :name => "line in/json filter/json out", :config => "config/json_inout_filter.conf", :input => "input/json_medium.txt", :time => 30}, + {:workers => 2, :name => "apache in/json out", :config => "config/simple.conf", :input => "input/apache_log.txt", :time => 30}, + {:workers => 2, :name => "apache in/grok codec/json out", :config => "config/simple_grok.conf", :input => "input/apache_log.txt", :time => 30}, + {:workers => 2, :name => "syslog in/json out", :config => "config/complex_syslog.conf", :input => "input/syslog_acl_10.txt", :time => 30}, +] diff --git a/lib/lsperfm/core.rb b/lib/lsperfm/core.rb index 75985b2..60a2dc9 100644 --- a/lib/lsperfm/core.rb +++ b/lib/lsperfm/core.rb @@ -23,8 +23,9 @@ def run(debug=false, headers=false) tests.each do |test| events = test[:events].to_i time = test[:time].to_i + workers = test[:workers] ? test[:workers].to_s : "1" - manager = runner.new(find_test_config(test[:config]), debug, install_path) + manager = runner.new(find_test_config(test[:config]), workers, debug, install_path) metrics = manager.run(events, time, runner.read_input_file(find_test_input(test[:input]))) lines << formatter(test[:name], metrics) end diff --git a/lib/lsperfm/core/run.rb b/lib/lsperfm/core/run.rb index e000088..2a540a8 100644 --- a/lib/lsperfm/core/run.rb +++ b/lib/lsperfm/core/run.rb @@ -18,9 +18,9 @@ class Runner attr_reader :command - def initialize(config, debug = false, logstash_home = Dir.pwd) + def initialize(config, workers = "1", debug = false, logstash_home = Dir.pwd) @debug = debug - @command = [File.join(logstash_home, LOGSTASH_BIN), "-f", config] + @command = [File.join(logstash_home, LOGSTASH_BIN), "-f", config, "-w", workers] end def run(required_events_count, required_run_time, input_lines) diff --git a/spec/fixtures/worker_basic_suite.rb b/spec/fixtures/worker_basic_suite.rb new file mode 100644 index 0000000..90a2257 --- /dev/null +++ b/spec/fixtures/worker_basic_suite.rb @@ -0,0 +1,4 @@ +[ + {:workers => 2, :name => "simple 1", :config => "simple.conf", :input => "simple_10.txt", :time => 5}, + {:workers => "2", :name => "simple 2", :config => "simple.conf", :input => "simple_10.txt", :time => 10}, +] diff --git a/spec/lib/runner_spec.rb b/spec/lib/runner_spec.rb index 5000d4a..6aae3e0 100644 --- a/spec/lib/runner_spec.rb +++ b/spec/lib/runner_spec.rb @@ -10,7 +10,7 @@ subject (:runner) { LogStash::PerformanceMeter::Runner.new(config) } - let(:command) { [File.join(Dir.pwd, LogStash::PerformanceMeter::Runner::LOGSTASH_BIN), "-f", "spec/fixtures/simple.conf"]} + let(:command) { [File.join(Dir.pwd, LogStash::PerformanceMeter::Runner::LOGSTASH_BIN), "-f", "spec/fixtures/simple.conf", "-w", "1"]} it "invokes the logstash command" do Open3.should_receive(:popen3).with(*command).and_return(true) diff --git a/spec/lib/suite_spec.rb b/spec/lib/suite_spec.rb index 5f9c781..5e22f03 100644 --- a/spec/lib/suite_spec.rb +++ b/spec/lib/suite_spec.rb @@ -19,7 +19,7 @@ context "using a file" do it "run each test case in a serial maner" do - expect(runner).to receive(:new).with("spec/fixtures/simple.conf", false, logstash_home).twice { serial_runner } + expect(runner).to receive(:new).with("spec/fixtures/simple.conf", "1", false, logstash_home).twice { serial_runner } manager.run end @@ -31,7 +31,7 @@ it "run each test case as expected" do expect(runner).to receive(:read_input_file).with('simple_10.txt').twice { [] } - expect(runner).to receive(:new).with("simple.conf", false, logstash_home).twice { serial_runner } + expect(runner).to receive(:new).with("simple.conf", "1", false, logstash_home).twice { serial_runner } manager.run end @@ -43,7 +43,7 @@ let(:config) { 'spec/fixtures/wrong_config.yml' } it "run each test case as expected" do - expect(runner).to receive(:new).with("spec/wrong_fixture/simple.conf", false, logstash_home).once { serial_runner } + expect(runner).to receive(:new).with("spec/wrong_fixture/simple.conf", "1", false, logstash_home).once { serial_runner } expect { manager.run }.to raise_error(LogStash::PerformanceMeter::ConfigException) end end diff --git a/spec/lib/worker_suite_spec.rb b/spec/lib/worker_suite_spec.rb new file mode 100644 index 0000000..30754b4 --- /dev/null +++ b/spec/lib/worker_suite_spec.rb @@ -0,0 +1,40 @@ +require 'spec_helper' + +describe LogStash::PerformanceMeter::Core do + + let(:config) { 'spec/fixtures/config.yml' } + let(:logstash_home) { '.' } + let(:suite_def) { 'spec/fixtures/worker_basic_suite.rb' } + let(:serial_runner) { double('DummySerialRunner') } + let(:runner) { LogStash::PerformanceMeter::Runner } + + let(:run_outcome) { { :percentile => [2000] , :elapsed => 100, :events_count => 3000, :start_time => 12 } } + subject(:manager) { LogStash::PerformanceMeter::Core.new(suite_def, logstash_home, config, runner) } + + context "with a valid configuration and worker threads set to 2" do + before(:each) do + expect(serial_runner).to receive(:run).with(0, 5, anything()).ordered { run_outcome } + expect(serial_runner).to receive(:run).with(0, 10, anything()).ordered { run_outcome } + end + context "using a file" do + + it "run each test case in a serial maner" do + expect(runner).to receive(:new).with("spec/fixtures/simple.conf", "2", false, logstash_home).twice { serial_runner } + manager.run + end + + end + + context "without a file" do + + let(:config) { '' } + + it "run each test case as expected" do + expect(runner).to receive(:read_input_file).with('simple_10.txt').twice { [] } + expect(runner).to receive(:new).with("simple.conf", "2", false, logstash_home).twice { serial_runner } + manager.run + end + + end + end +end From 4654cec9b69bf1e69ac9759f79a65ad30e5896c8 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 21 Oct 2015 15:23:01 -0700 Subject: [PATCH 2/6] Change workers var to int and convert to string in popen --- lib/lsperfm/core.rb | 2 +- lib/lsperfm/core/run.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/lsperfm/core.rb b/lib/lsperfm/core.rb index 60a2dc9..563154d 100644 --- a/lib/lsperfm/core.rb +++ b/lib/lsperfm/core.rb @@ -23,7 +23,7 @@ def run(debug=false, headers=false) tests.each do |test| events = test[:events].to_i time = test[:time].to_i - workers = test[:workers] ? test[:workers].to_s : "1" + workers = test[:workers] ? test[:workers] : 1 manager = runner.new(find_test_config(test[:config]), workers, debug, install_path) metrics = manager.run(events, time, runner.read_input_file(find_test_input(test[:input]))) diff --git a/lib/lsperfm/core/run.rb b/lib/lsperfm/core/run.rb index 2a540a8..db65a4e 100644 --- a/lib/lsperfm/core/run.rb +++ b/lib/lsperfm/core/run.rb @@ -18,9 +18,9 @@ class Runner attr_reader :command - def initialize(config, workers = "1", debug = false, logstash_home = Dir.pwd) + def initialize(config, workers = 1, debug = false, logstash_home = Dir.pwd) @debug = debug - @command = [File.join(logstash_home, LOGSTASH_BIN), "-f", config, "-w", workers] + @command = [File.join(logstash_home, LOGSTASH_BIN), "-f", config, "-w", workers.to_s] end def run(required_events_count, required_run_time, input_lines) From a05a89d31c891dfafa7523725e4f4491866a9cd6 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 21 Oct 2015 15:24:00 -0700 Subject: [PATCH 3/6] Change number of workers to variable --- spec/fixtures/worker_basic_suite.rb | 2 +- spec/lib/suite_spec.rb | 6 +++--- spec/lib/worker_suite_spec.rb | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/spec/fixtures/worker_basic_suite.rb b/spec/fixtures/worker_basic_suite.rb index 90a2257..67502d3 100644 --- a/spec/fixtures/worker_basic_suite.rb +++ b/spec/fixtures/worker_basic_suite.rb @@ -1,4 +1,4 @@ [ {:workers => 2, :name => "simple 1", :config => "simple.conf", :input => "simple_10.txt", :time => 5}, - {:workers => "2", :name => "simple 2", :config => "simple.conf", :input => "simple_10.txt", :time => 10}, + {:workers => 2, :name => "simple 2", :config => "simple.conf", :input => "simple_10.txt", :time => 10}, ] diff --git a/spec/lib/suite_spec.rb b/spec/lib/suite_spec.rb index 5e22f03..5e5974c 100644 --- a/spec/lib/suite_spec.rb +++ b/spec/lib/suite_spec.rb @@ -19,7 +19,7 @@ context "using a file" do it "run each test case in a serial maner" do - expect(runner).to receive(:new).with("spec/fixtures/simple.conf", "1", false, logstash_home).twice { serial_runner } + expect(runner).to receive(:new).with("spec/fixtures/simple.conf", 1, false, logstash_home).twice { serial_runner } manager.run end @@ -31,7 +31,7 @@ it "run each test case as expected" do expect(runner).to receive(:read_input_file).with('simple_10.txt').twice { [] } - expect(runner).to receive(:new).with("simple.conf", "1", false, logstash_home).twice { serial_runner } + expect(runner).to receive(:new).with("simple.conf", 1, false, logstash_home).twice { serial_runner } manager.run end @@ -43,7 +43,7 @@ let(:config) { 'spec/fixtures/wrong_config.yml' } it "run each test case as expected" do - expect(runner).to receive(:new).with("spec/wrong_fixture/simple.conf", "1", false, logstash_home).once { serial_runner } + expect(runner).to receive(:new).with("spec/wrong_fixture/simple.conf", 1, false, logstash_home).once { serial_runner } expect { manager.run }.to raise_error(LogStash::PerformanceMeter::ConfigException) end end diff --git a/spec/lib/worker_suite_spec.rb b/spec/lib/worker_suite_spec.rb index 30754b4..8aeca9c 100644 --- a/spec/lib/worker_suite_spec.rb +++ b/spec/lib/worker_suite_spec.rb @@ -7,6 +7,7 @@ let(:suite_def) { 'spec/fixtures/worker_basic_suite.rb' } let(:serial_runner) { double('DummySerialRunner') } let(:runner) { LogStash::PerformanceMeter::Runner } + let(:workers) { 2 } let(:run_outcome) { { :percentile => [2000] , :elapsed => 100, :events_count => 3000, :start_time => 12 } } subject(:manager) { LogStash::PerformanceMeter::Core.new(suite_def, logstash_home, config, runner) } @@ -19,7 +20,7 @@ context "using a file" do it "run each test case in a serial maner" do - expect(runner).to receive(:new).with("spec/fixtures/simple.conf", "2", false, logstash_home).twice { serial_runner } + expect(runner).to receive(:new).with("spec/fixtures/simple.conf", workers, false, logstash_home).twice { serial_runner } manager.run end @@ -31,7 +32,7 @@ it "run each test case as expected" do expect(runner).to receive(:read_input_file).with('simple_10.txt').twice { [] } - expect(runner).to receive(:new).with("simple.conf", "2", false, logstash_home).twice { serial_runner } + expect(runner).to receive(:new).with("simple.conf", workers, false, logstash_home).twice { serial_runner } manager.run end From b16addc76d861e75acf4774935bcdaacc618e45e Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 21 Oct 2015 15:32:07 -0700 Subject: [PATCH 4/6] Added note about logstash 2.0 default thread number. --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 81dad6e..a870995 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,11 @@ a suite file defines a series of tests to run. # you can specify the number of filter worker threads for each test with :workers => N # if you don't specify workers, it defaults to 1 # +# Note: Logstash 2.0 has new default worker thread behavior: It defaults to half the number +# of cpus for the number of worker threads. So a 4 CPU machine would get 2 threads by default. +# This is different than logstash 1.x where the default was always 1 worker thread. Lsperfm +# will *always* default to 1 worker regardless of logstash version. +# #[ # {:name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 30}, # {:workers => 2, :name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, From 9c360edcc0fcd97722f68345ed5b6401bcb0cd78 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 21 Oct 2015 15:38:15 -0700 Subject: [PATCH 5/6] Deleted with_workers examples --- .../basic_performance_long_with_workers.rb | 21 ------------------- .../basic_performance_quick_with_workers.rb | 21 ------------------- 2 files changed, 42 deletions(-) delete mode 100644 examples/suite/basic_performance_long_with_workers.rb delete mode 100644 examples/suite/basic_performance_quick_with_workers.rb diff --git a/examples/suite/basic_performance_long_with_workers.rb b/examples/suite/basic_performance_long_with_workers.rb deleted file mode 100644 index 6595d1c..0000000 --- a/examples/suite/basic_performance_long_with_workers.rb +++ /dev/null @@ -1,21 +0,0 @@ -# format description: -# each test can be executed by either target duration using :time => N secs -# or by number of events with :events => N -# -# you can specify the number of filter worker threads for each test with :workers => N -# if you don't specify workers, it defaults to 1 -# -#[ -# {:name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 30}, -# {:workers => 2, :name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, -#] -# -[ - {:workers => 2, :name => "simple line in/out", :config => "config/simple.conf", :input => "input/simple_10.txt", :time => 120}, - {:workers => 2, :name => "simple line in/json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 120}, - {:workers => 2, :name => "json codec in/out", :config => "config/json_inout_codec.conf", :input => "input/json_medium.txt", :time => 120}, - {:workers => 2, :name => "line in/json filter/json out", :config => "config/json_inout_filter.conf", :input => "input/json_medium.txt", :time => 120}, - {:workers => 2, :name => "apache in/json out", :config => "config/simple.conf", :input => "input/apache_log.txt", :time => 120}, - {:workers => 2, :name => "apache in/grok codec/json out", :config => "config/simple_grok.conf", :input => "input/apache_log.txt", :time => 120}, - {:workers => 2, :name => "syslog in/json out", :config => "config/complex_syslog.conf", :input => "input/syslog_acl_10.txt", :time => 120}, -] diff --git a/examples/suite/basic_performance_quick_with_workers.rb b/examples/suite/basic_performance_quick_with_workers.rb deleted file mode 100644 index 091093c..0000000 --- a/examples/suite/basic_performance_quick_with_workers.rb +++ /dev/null @@ -1,21 +0,0 @@ -# format description: -# each test can be executed by either target duration using :time => N secs -# or by number of events with :events => N -# -# you can specify the number of filter worker threads for each test with :workers => N -# if you don't specify workers, it defaults to 1 -# -#[ -# {:name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 30}, -# {:workers => 2, :name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, -#] -# -[ - {:workers => 2, :name => "simple line in/out", :config => "config/simple.conf", :input => "input/simple_10.txt", :time => 30}, - {:workers => 2, :name => "simple line in/json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 30}, - {:workers => 2, :name => "json codec in/out", :config => "config/json_inout_codec.conf", :input => "input/json_medium.txt", :time => 30}, - {:workers => 2, :name => "line in/json filter/json out", :config => "config/json_inout_filter.conf", :input => "input/json_medium.txt", :time => 30}, - {:workers => 2, :name => "apache in/json out", :config => "config/simple.conf", :input => "input/apache_log.txt", :time => 30}, - {:workers => 2, :name => "apache in/grok codec/json out", :config => "config/simple_grok.conf", :input => "input/apache_log.txt", :time => 30}, - {:workers => 2, :name => "syslog in/json out", :config => "config/complex_syslog.conf", :input => "input/syslog_acl_10.txt", :time => 30}, -] From 741a363ac084137d22041d26c4576f6bfa624a59 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 21 Oct 2015 15:38:37 -0700 Subject: [PATCH 6/6] Mixed :workers into the example suites. --- examples/suite/basic_performance_long.rb | 7 ++++--- examples/suite/basic_performance_quick.rb | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/suite/basic_performance_long.rb b/examples/suite/basic_performance_long.rb index c315174..3d555a6 100644 --- a/examples/suite/basic_performance_long.rb +++ b/examples/suite/basic_performance_long.rb @@ -10,12 +10,13 @@ # {:workers => 2, :name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, #] # +# We use 2 workers here as an example, since most machines can handle that, but machines with more CPUs can handle more threads. [ {:name => "simple line in/out", :config => "config/simple.conf", :input => "input/simple_10.txt", :time => 120}, - {:name => "simple line in/json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 120}, + {:workers => 2, :name => "simple line in/json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 120}, {:name => "json codec in/out", :config => "config/json_inout_codec.conf", :input => "input/json_medium.txt", :time => 120}, - {:name => "line in/json filter/json out", :config => "config/json_inout_filter.conf", :input => "input/json_medium.txt", :time => 120}, + {:workers => 2, :name => "line in/json filter/json out", :config => "config/json_inout_filter.conf", :input => "input/json_medium.txt", :time => 120}, {:name => "apache in/json out", :config => "config/simple.conf", :input => "input/apache_log.txt", :time => 120}, - {:name => "apache in/grok codec/json out", :config => "config/simple_grok.conf", :input => "input/apache_log.txt", :time => 120}, + {:workers => 2, :name => "apache in/grok codec/json out", :config => "config/simple_grok.conf", :input => "input/apache_log.txt", :time => 120}, {:name => "syslog in/json out", :config => "config/complex_syslog.conf", :input => "input/syslog_acl_10.txt", :time => 120}, ] diff --git a/examples/suite/basic_performance_quick.rb b/examples/suite/basic_performance_quick.rb index 8dc5fab..ccdde8b 100644 --- a/examples/suite/basic_performance_quick.rb +++ b/examples/suite/basic_performance_quick.rb @@ -10,12 +10,13 @@ # {:workers => 2, :name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, #] # +# We use 2 workers here as an example since most machines can handle that, but machines with more CPUs can handle more threads. [ {:name => "simple line in/out", :config => "config/simple.conf", :input => "input/simple_10.txt", :time => 30}, - {:name => "simple line in/json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 30}, + {:workers => 2, :name => "simple line in/json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :time => 30}, {:name => "json codec in/out", :config => "config/json_inout_codec.conf", :input => "input/json_medium.txt", :time => 30}, - {:name => "line in/json filter/json out", :config => "config/json_inout_filter.conf", :input => "input/json_medium.txt", :time => 30}, + {:workers => 2, :name => "line in/json filter/json out", :config => "config/json_inout_filter.conf", :input => "input/json_medium.txt", :time => 30}, {:name => "apache in/json out", :config => "config/simple.conf", :input => "input/apache_log.txt", :time => 30}, - {:name => "apache in/grok codec/json out", :config => "config/simple_grok.conf", :input => "input/apache_log.txt", :time => 30}, + {:workers => 2, :name => "apache in/grok codec/json out", :config => "config/simple_grok.conf", :input => "input/apache_log.txt", :time => 30}, {:name => "syslog in/json out", :config => "config/complex_syslog.conf", :input => "input/syslog_acl_10.txt", :time => 30}, ]