[Groonga-commit] droonga/drnbench at 49cfa02 [master] Accept "--mode" option to specify bencmark mode

アーカイブの一覧に戻る

YUKI Hiroshi null+****@clear*****
Fri Oct 11 17:05:53 JST 2013


YUKI Hiroshi	2013-10-11 17:05:53 +0900 (Fri, 11 Oct 2013)

  New Revision: 49cfa025e241ad4f08d650585326b1a061ed47d8
  https://github.com/droonga/drnbench/commit/49cfa025e241ad4f08d650585326b1a061ed47d8

  Message:
    Accept "--mode" option to specify bencmark mode

  Modified files:
    bin/drnbench
    lib/droonga/benchmark/runner.rb

  Modified: bin/drnbench (+8 -0)
===================================================================
--- bin/drnbench    2013-10-11 16:59:57 +0900 (53a98cb)
+++ bin/drnbench    2013-10-11 17:05:53 +0900 (30c4737)
@@ -9,6 +9,7 @@ options = {
   :start_n_clients => 1,
   :end_n_clients => 1,
   :step => 1,
+  :mode => :http,
   :report_progressively => true,
   :output_path => "/tmp/drnbench-result.csv",
 }
@@ -34,6 +35,13 @@ option_parser = OptionParser.new do |parser|
     options[:step] = step
   end
 
+  parser.on("--mode=MODE", String,
+            "mode of bencmark (optional)",
+            "available modes:",
+            "  http",
+            "  http-droonga-search") do |mode|
+    options[:mode] = mode.gsub(/-/, "_")
+  end
   parser.on("--request-patterns-file=PATH",
             "path to request patterns JSON file") do |path|
     options[:request_patterns_file] = File.expand_path(path)

  Modified: lib/droonga/benchmark/runner.rb (+9 -2)
===================================================================
--- lib/droonga/benchmark/runner.rb    2013-10-11 16:59:57 +0900 (a677c1f)
+++ lib/droonga/benchmark/runner.rb    2013-10-11 17:05:53 +0900 (5183cde)
@@ -52,9 +52,16 @@ module Droonga
         @result = Result.new(:n_clients => @n_clients,
                              :duration => @duration)
 
+        client_params =****@param*****(:requests => requests_queue,
+                                      :result => @result)
         @clients = @n_clients.times.collect do |index|
-          client = HttpClient.new(@params.merge(:requests => requests_queue,
-                                                :result => @result))
+          client = nil
+          case @params[:mode]
+          when :http
+            client = HttpClient.new(client_params)
+          when :http_droonga_search
+            client = HttpDroongaSearchClient.new(client_params)
+          end
           client.run
           client
         end
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る