YUKI Hiroshi
null+****@clear*****
Mon Oct 28 13:05:37 JST 2013
YUKI Hiroshi 2013-10-28 13:05:37 +0900 (Mon, 28 Oct 2013) New Revision: 06e9c346537a99e191f062b815cefe6fe3077f0e https://github.com/droonga/fluent-plugin-droonga/commit/06e9c346537a99e191f062b815cefe6fe3077f0e Message: Benchmark: add experimental code to add keywords and subscribers Modified files: benchmark/utils.rb Modified: benchmark/utils.rb (+27 -0) =================================================================== --- benchmark/utils.rb 2013-10-28 12:52:17 +0900 (71daba6) +++ benchmark/utils.rb 2013-10-28 13:05:37 +0900 (de1583c) @@ -54,6 +54,33 @@ module DroongaBenchmark @context.send("]") end +=begin +# this is slower than above... + def subscribe_to_with_single_loop(terms) + queries = [] + subscribers = [] + terms.each do |term| + queries << {:_key => term, + :keywords => [term]} + subscribers << {:_key => "subscriber for #{term}", + :subscriptions => [term], + :route => "0.0.0.0:0/benchamrk"} + end + + command_load_queries = [ + "load --table Query", + JSON.generate(queries) + ] + command_load_subscribers = [ + "load --table Subscriber", + JSON.generate(subscribers) + ] + + @context.restore(command_load_queries.join("\n")) + @context.restore(command_load_subscribers.join("\n")) + end +=end + def subscribe(term) queries = @context["Query"] query = queries.add(term, :keywords => [term]) -------------- next part -------------- HTML����������������������������... Download