YUKI Hiroshi
null+****@clear*****
Mon Oct 28 18:46:33 JST 2013
YUKI Hiroshi 2013-10-28 18:46:33 +0900 (Mon, 28 Oct 2013) New Revision: 1f320b3a6cc7dcf524a7570b9371000192589924 https://github.com/droonga/fluent-plugin-droonga/commit/1f320b3a6cc7dcf524a7570b9371000192589924 Message: Benchmark: load DDL in the setup process Modified files: benchmark/watch/benchmark-notify.rb benchmark/watch/benchmark-notify.sh Modified: benchmark/watch/benchmark-notify.rb (+13 -2) =================================================================== --- benchmark/watch/benchmark-notify.rb 2013-10-28 18:33:00 +0900 (fa46fd5) +++ benchmark/watch/benchmark-notify.rb 2013-10-28 18:46:33 +0900 (6688754) @@ -21,6 +21,7 @@ require "benchmark" require "fileutils" require "optparse" require "csv" +require "json" require "droonga/client" @@ -41,6 +42,16 @@ class NotifyBenchmark @client = Droonga::Client.new(tag: "droonga", port: 23003) @receiver = Droonga::Client::Connection::DroongaProtocol::Receiver.new @route = "#{@receiver.host}:#{@receiver.port}/droonga" + setup + end + + def setup + ddl_path = File.expand_path(File.join(__FILE__, "..", "..", "..", "ddl", "watchdb.jsons")) + ddl_jsons = File.read(ddl_path) + ddl_jsons.split("\n").each do |part| + message = JSON.parse(part) + @client.connection.send_receive(message) + end add_subscribers(@params[:n_initial_subscribers]) end @@ -48,12 +59,13 @@ class NotifyBenchmark @n_times.times do do_feed(WATCHING_KEYWORD) end + p****@recei*****(:timeout => @timeout) end def add_subscribers(n_subscribers) n_subscribers.times do message = DroongaBenchmark::MessageCreator.envelope_to_subscribe(WATCHING_KEYWORD, @route) - @client.connection.send_receive(message) + @client.connection.send(message) end @n_subscribers += n_subscribers end @@ -61,7 +73,6 @@ class NotifyBenchmark def do_feed(target) message = DroongaBenchmark::MessageCreator.envelope_to_feed(target) @client.connection.send(message) - @receiver.receive(:timeout => @timeout) end end Modified: benchmark/watch/benchmark-notify.sh (+0 -2) =================================================================== --- benchmark/watch/benchmark-notify.sh 2013-10-28 18:33:00 +0900 (d3eb999) +++ benchmark/watch/benchmark-notify.sh 2013-10-28 18:46:33 +0900 (8110ae5) @@ -12,8 +12,6 @@ FLUENTD_PID=$! sleep 1 -bundle exec fluent-cat -p 23003 droonga.message < $base_dir/../../ddl/watchdb.jsons - bundle exec ruby $base_dir/benchmark-notify.rb "$@" kill $FLUENTD_PID -------------- next part -------------- HTML����������������������������...ダウンロード