Class: Foo
Instance Method Summary collapse
Methods included from Hallmonitor::Monitored
Instance Method Details
#do_something ⇒ Object
15 16 17 18 19 |
# File 'bin/example.rb', line 15 def do_something sleep_time_ms = ((Random.rand * 100).floor) * 2 puts "Sleeping for #{sleep_time_ms} milliseconds" sleep(sleep_time_ms / 1000.0) end |
#emit_events(count = 30) ⇒ Object
23 24 25 26 27 28 29 |
# File 'bin/example.rb', line 23 def emit_events(count=30) # Emit 100 events count.times do emit("event") sleep(1) end end |
#time_me ⇒ Object
31 32 33 34 35 |
# File 'bin/example.rb', line 31 def time_me watch("timed") do |x| sleep(10) end end |