From 5e0e9a0aabb1bb74c15b36d074dbe3513b1e8a15 Mon Sep 17 00:00:00 2001 From: Colin Surprenant Date: Tue, 9 Feb 2016 17:10:27 -0500 Subject: [PATCH 1/2] fix paths and move them as constants --- examples/suite/basic_performance_long.rb | 23 +++++++++++++++-------- examples/suite/basic_performance_quick.rb | 22 ++++++++++++++-------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/examples/suite/basic_performance_long.rb b/examples/suite/basic_performance_long.rb index 651f4ca..5fc998e 100644 --- a/examples/suite/basic_performance_long.rb +++ b/examples/suite/basic_performance_long.rb @@ -7,12 +7,19 @@ # {:name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, #] # +TIME = 120 +CONFIG_PATH = "examples/config/" +INPUT_PATH = "examples/input/" + [ - {: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}, - {: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}, - {: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}, - {:name => "syslog in/json out", :config => "config/complex_syslog.conf", :input => "input/syslog_acl_10.txt", :time => 120}, -] + {:name => "simple line in/out", :config => "simple.conf", :input => "simple_10.txt", :time => TIME}, + {:name => "simple line in/json out", :config => "simple_json_out.conf", :input => "simple_10.txt", :time => TIME}, + {:name => "json codec in/out", :config => "json_inout_codec.conf", :input => "json_medium.txt", :time => TIME}, + {:name => "line in/json filter/json out", :config => "json_inout_filter.conf", :input => "json_medium.txt", :time => TIME}, + {:name => "apache in/json out", :config => "simple.conf", :input => "apache_log.txt", :time => TIME}, + {:name => "apache in/grok codec/json out", :config => "simple_grok.conf", :input => "apache_log.txt", :time => TIME}, + {:name => "syslog in/json out", :config => "complex_syslog.conf", :input => "syslog_acl_10.txt", :time => TIME}, +].map do |test| + test.merge({:config => CONFIG_PATH + test[:config], :input => INPUT_PATH + test[:input], :time => TIME}) +end + diff --git a/examples/suite/basic_performance_quick.rb b/examples/suite/basic_performance_quick.rb index afaf948..5810db3 100644 --- a/examples/suite/basic_performance_quick.rb +++ b/examples/suite/basic_performance_quick.rb @@ -7,12 +7,18 @@ # {:name => "simple json out", :config => "config/simple_json_out.conf", :input => "input/simple_10.txt", :events => 50000}, #] # +TIME = 30 +CONFIG_PATH = "examples/config/" +INPUT_PATH = "examples/input/" + [ - {: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}, - {: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}, - {: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}, - {:name => "syslog in/json out", :config => "config/complex_syslog.conf", :input => "input/syslog_acl_10.txt", :time => 30}, -] + {:name => "simple line in/out", :config => "simple.conf", :input => "simple_10.txt", :time => TIME}, + {:name => "simple line in/json out", :config => "simple_json_out.conf", :input => "simple_10.txt", :time => TIME}, + {:name => "json codec in/out", :config => "json_inout_codec.conf", :input => "json_medium.txt", :time => TIME}, + {:name => "line in/json filter/json out", :config => "json_inout_filter.conf", :input => "json_medium.txt", :time => TIME}, + {:name => "apache in/json out", :config => "simple.conf", :input => "apache_log.txt", :time => TIME}, + {:name => "apache in/grok codec/json out", :config => "simple_grok.conf", :input => "apache_log.txt", :time => TIME}, + {:name => "syslog in/json out", :config => "complex_syslog.conf", :input => "syslog_acl_10.txt", :time => TIME}, +].map do |test| + test.merge({:config => CONFIG_PATH + test[:config], :input => INPUT_PATH + test[:input], :time => TIME}) +end From e3686d90d2597f25a6e4621253d18e15e1d57e70 Mon Sep 17 00:00:00 2001 From: Colin Surprenant Date: Tue, 9 Feb 2016 17:11:18 -0500 Subject: [PATCH 2/2] fix environment to allow launching bundler based apps --- lib/lsperfm/core/run.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lsperfm/core/run.rb b/lib/lsperfm/core/run.rb index e000088..f6b378c 100644 --- a/lib/lsperfm/core/run.rb +++ b/lib/lsperfm/core/run.rb @@ -27,7 +27,7 @@ def run(required_events_count, required_run_time, input_lines) puts("launching #{command.join(" ")} #{required_events_count} #{required_run_time}") if @debug stats = LogStash::PerformanceMeter::Stats.new real_events_count = 0 - Open3.popen3(*@command) do |i, o, e| + Open3.popen3({:BUNDLE_BIN_PATH => "", :BUNDLE_GEMFILE => "", :RUBYOPT => ""}, *@command) do |i, o, e| puts("sending initial event") if @debug start_time = Benchmark.realtime do i.puts(INITIAL_MESSAGE)