YUKI Hiroshi
null+****@clear*****
Fri Oct 25 17:29:47 JST 2013
YUKI Hiroshi 2013-10-25 17:29:47 +0900 (Fri, 25 Oct 2013) New Revision: 1ba80a827a36c5319f933290f629916cfd6742fd https://github.com/droonga/fluent-plugin-droonga/commit/1ba80a827a36c5319f933290f629916cfd6742fd Message: Benchmark: setup temporary database on every benchmark Modified files: benchmark/watch/benchmark-scan.rb Modified: benchmark/watch/benchmark-scan.rb (+9 -1) =================================================================== --- benchmark/watch/benchmark-scan.rb 2013-10-25 17:09:32 +0900 (35ca771) +++ benchmark/watch/benchmark-scan.rb 2013-10-25 17:29:47 +0900 (aaee923) @@ -16,6 +16,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require "benchmark" +require "fileutils" require "groonga" @@ -28,7 +29,14 @@ class StubWorker end end -Groonga::Database.open("/tmp/watch/db") + +database_path = "/tmp/watch-benchmark" +ddl_path = File.expand_path(File.join(__FILE__, "..", "benchmark-watch-ddl.grn")) +FileUtils.rm_rf(database_path) +FileUtils.mkdir_p(database_path) +`cat #{ddl_path} | groonga -n #{database_path}/db` + +Groonga::Database.open("#{database_path}/db") worker = StubWorker.new(Groonga::Context.default) watch = Droonga::WatchHandler.new(worker) -------------- next part -------------- HTML����������������������������... Download