[Groonga-commit] groonga/groonga at 94485f1 [master] Make the number of records customizable

Back to archive index
Kouhei Sutou null+****@clear*****
Fri Jan 18 17:48:30 JST 2019


Kouhei Sutou	2019-01-18 17:48:30 +0900 (Fri, 18 Jan 2019)

  Revision: 94485f1661f43fb3fe37ec8c572b220390c3e5c3
  https://github.com/groonga/groonga/commit/94485f1661f43fb3fe37ec8c572b220390c3e5c3

  Message:
    Make the number of records customizable

  Modified files:
    tools/generate-long-posting-list-data.rb

  Modified: tools/generate-long-posting-list-data.rb (+11 -2)
===================================================================
--- tools/generate-long-posting-list-data.rb    2019-01-18 09:32:29 +0900 (595d768a3)
+++ tools/generate-long-posting-list-data.rb    2019-01-18 17:48:30 +0900 (cd24d3cbb)
@@ -1,6 +1,15 @@
 #!/usr/bin/env ruby
 
 require "json"
+require "optparse"
+
+n_records = 100000
+parser = OptionParser.new
+parser.on("--n-records=N", Integer,
+          "[#{n_records}]") do |n|
+  n_records = n
+end
+parser.parse!
 
 puts(<<-COMMANDS)
 table_create Data TABLE_NO_KEY
@@ -16,9 +25,9 @@ puts(<<-LOAD)
 load --table Data
 [
 LOAD
-100000.times do
+n_records.times do
   puts({"value" => "X"}.to_json)
 end
 puts(<<-LOAD)
 ]
-LAOD
+LOAD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190118/06b406db/attachment.html>


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