Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add verbose mode

  • Loading branch information...
commit f85fc1be947f1205d7f00ccde5d27d4d3d0acad5 1 parent 78a286c
@avsej authored
Showing with 14 additions and 7 deletions.
  1. +14 −7 run.rb
View
21 run.rb
@@ -83,6 +83,9 @@
opts.on("-p", "--passwd PASSWORD", "Password to log with (default: none)") do |v|
options[:passwd] = v
end
+ opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
+ options[:verbose] = v
+ end
opts.on_tail("-?", "--help", "Show this message") do
puts opts
exit
@@ -102,16 +105,20 @@
cc = EM::Protocols::Couchbase.connect
on_complete = lambda do |ret|
ops_per_fork -= 1
-# case ret.operation
-# when :set
-# STDERR.print("s")
-# when :get
-# STDERR.print("g")
-# end
+ if options[:verbose]
+ case ret.operation
+ when :set
+ STDERR.print("s")
+ when :get
+ STDERR.print("g")
+ end
+ end
EM.stop if ops_per_fork < 0
end
on_tick = lambda do
-# STDERR.print(".")
+ if options[:verbose]
+ STDERR.print(".")
+ end
options[:slice].times do
if rand > options[:ratio]
cc.set("#{options[:prefix]}fork-#{n}:#{n % 10}", value, &on_complete)
Please sign in to comment.
Something went wrong with that request. Please try again.