[Groonga-commit] droonga/http-benchmark at 897db8f [master] Convert type of arguments by OptionParser

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Oct 7 15:20:09 JST 2013


YUKI Hiroshi	2013-10-07 15:20:09 +0900 (Mon, 07 Oct 2013)

  New Revision: 897db8fcdf4b8bb989f8ba9fa6f4b839349308ab
  https://github.com/droonga/http-benchmark/commit/897db8fcdf4b8bb989f8ba9fa6f4b839349308ab

  Message:
    Convert type of arguments by OptionParser

  Modified files:
    bin/http-benchmark

  Modified: bin/http-benchmark (+4 -4)
===================================================================
--- bin/http-benchmark    2013-10-07 14:59:13 +0900 (cbef2c6)
+++ bin/http-benchmark    2013-10-07 15:20:09 +0900 (924217e)
@@ -6,13 +6,13 @@ require "optparse"
 
 options = {}
 option_parser = OptionParser.new do |parser|
-  parser.on("--duration=SECONDS",
+  parser.on("--duration=SECONDS", Float,
             "duration of the benmark") do |duration|
-    options[:duration] = duration.to_f
+    options[:duration] = duration
   end
-  parser.on("--threads=COUNT",
+  parser.on("--threads=COUNT", Integer,
             "count of threads") do |threads|
-    options[:threads] = threads.to_i
+    options[:threads] = threads
   end
 end
 args = option_parser.parse!(ARGV)
-------------- next part --------------
HTML����������������������������...
Download 



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