[Groonga-commit] droonga/drnbench at 63ef772 [master] Implement HttpDroongaSearchClient

Back to archive index

YUKI Hiroshi null+****@clear*****
Fri Oct 11 16:59:57 JST 2013


YUKI Hiroshi	2013-10-11 16:59:57 +0900 (Fri, 11 Oct 2013)

  New Revision: 63ef77267785263d92ee4fc5abc1e94a4fe40125
  https://github.com/droonga/drnbench/commit/63ef77267785263d92ee4fc5abc1e94a4fe40125

  Message:
    Implement HttpDroongaSearchClient

  Added files:
    lib/droonga/benchmark/client/http-droonga-search.rb
  Modified files:
    lib/droonga/benchmark/runner.rb

  Added: lib/droonga/benchmark/client/http-droonga-search.rb (+28 -0) 100644
===================================================================
--- /dev/null
+++ lib/droonga/benchmark/client/http-droonga-search.rb    2013-10-11 16:59:57 +0900 (3ee0266)
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+
+module Droonga
+  module Benchmark
+    class HttpDroongaSearchClient << HttpClient
+      DEFAULT_PATH = "/droonga/search"
+      DEFAULT_METHOD = "POST"
+
+      def initialize(params)
+        params[:path] ||= DEFAULT_PATH
+        params[:method] ||= DEFAULT_METHOD
+        super
+        populate_requests
+      end
+
+      private
+      def populate_requests
+        @requests.collect! do |queries|
+          {
+            :body => {
+              :queries => queries,
+            },
+          }
+        end
+      end
+    end
+  end
+end

  Modified: lib/droonga/benchmark/runner.rb (+1 -0)
===================================================================
--- lib/droonga/benchmark/runner.rb    2013-10-11 10:24:47 +0900 (8ae2665)
+++ lib/droonga/benchmark/runner.rb    2013-10-11 16:59:57 +0900 (a677c1f)
@@ -1,6 +1,7 @@
 # -*- coding: utf-8 -*-
 
 require "droonga/benchmark/client/http"
+require "droonga/benchmark/client/http-droonga-search"
 require "droonga/benchmark/result"
 
 module Droonga
-------------- next part --------------
HTML����������������������������...
Download 



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