[Groonga-commit] droonga/http-benchmark at 324f986 [master] Load request patterns from the specified path

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Oct 9 17:53:54 JST 2013


YUKI Hiroshi	2013-10-09 17:53:54 +0900 (Wed, 09 Oct 2013)

  New Revision: 324f986204d3c930c96e99baf77cac7bbcef032e
  https://github.com/droonga/http-benchmark/commit/324f986204d3c930c96e99baf77cac7bbcef032e

  Message:
    Load request patterns from the specified path

  Modified files:
    bin/http-benchmark

  Modified: bin/http-benchmark (+13 -0)
===================================================================
--- bin/http-benchmark    2013-10-09 17:49:19 +0900 (9ee01d8)
+++ bin/http-benchmark    2013-10-09 17:53:54 +0900 (58f4a35)
@@ -3,6 +3,7 @@
 
 require "droonga/http-benchmark"
 require "optparse"
+require "json"
 
 options = {
   :start_n_clients => 1,
@@ -33,6 +34,11 @@ option_parser = OptionParser.new do |parser|
     options[:step] = step
   end
 
+  parser.on("--request-patterns-file=PATH",
+            "path to request patterns JSON file") do |path|
+    options[:request_patterns_file] = File.expand_path(path)
+  end
+
   parser.on("--host=HOST", String,
             "default host name (optional)") do |host|
     options[:host] = host
@@ -60,6 +66,13 @@ args = option_parser.parse!(ARGV)
 if options[:duration].nil?
   raise "You must specify the test duration by --duration option."
 end
+if options[:request_patterns_file].nil?
+  raise "You must specify the path to the request patterns JSON file " +
+          "by --request-patterns-file option."
+end
+
+request_patterns = File.read(options[:request_patterns_file])
+options[:request_patterns] = JSON.parse(request_patterns)
 
 runner = Droonga::HttpBenchmark::GradualRunner.new(options)
 runner.run
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index