[Groonga-commit] droonga/drnbench at a95f8a2 [master] Convert droonga request type input to regular HTTP request correctly

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Jan 20 15:17:19 JST 2014


YUKI Hiroshi	2014-01-20 15:17:19 +0900 (Mon, 20 Jan 2014)

  New Revision: a95f8a2ad9cd2ee75aa97075a474f3f4bb69cdd3
  https://github.com/droonga/drnbench/commit/a95f8a2ad9cd2ee75aa97075a474f3f4bb69cdd3

  Message:
    Convert droonga request type input to regular HTTP request correctly

  Modified files:
    lib/drnbench/client/http-droonga.rb
    lib/drnbench/client/http.rb

  Modified: lib/drnbench/client/http-droonga.rb (+5 -13)
===================================================================
--- lib/drnbench/client/http-droonga.rb    2014-01-20 15:13:08 +0900 (c035f5a)
+++ lib/drnbench/client/http-droonga.rb    2014-01-20 15:17:19 +0900 (026c45e)
@@ -9,24 +9,16 @@ module Drnbench
     def initialize(params, config)
       super
       @command = params["command"] || DEFAULT_COMMAND
-      @requests = populate_http_requests(@requests)
     end
 
     private
-    def populate_http_requests(requests)
-      requests.collect do |queries|
-        {
-          "body" => {
-            "queries" => queries,
-          },
-        }
-      end
-    end
-
     def fixup_request(request)
-      reqyest["path"]   ||= "#{DEFAULT_PATH_BASE}/#{@command}"
+      request = {
+        "body" => request,
+      }
+      request["path"]   ||= "#{DEFAULT_PATH_BASE}/#{@command}"
       request["method"] ||= DEFAULT_METHOD
-      super
+      super(request)
     end
   end
 end

  Modified: lib/drnbench/client/http.rb (+1 -1)
===================================================================
--- lib/drnbench/client/http.rb    2014-01-20 15:13:08 +0900 (46d53dd)
+++ lib/drnbench/client/http.rb    2014-01-20 15:17:19 +0900 (38aa0c1)
@@ -18,7 +18,7 @@ module Drnbench
       @thread = Thread.new do
         loop do
           request =****@reque*****
-          fixup_request(request)
+          request = fixup_request(request)
 
           Net::HTTP.start(request["host"], request["port"]) do |http|
             header = {
-------------- next part --------------
HTML����������������������������...
Download 



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