Sha256: ec181a4d6331b0de564f20f784b9ee69bad892908788c7356a96b4a47480d831
Contents?: true
Size: 701 Bytes
Versions: 12
Compression:
Stored size: 701 Bytes
Contents
require 'rubygems' require '../lib/ruby-metrics/integration/webrick' @metrics = Metrics::Agent.new @metrics.start :port => 8081 # optional timer = @metrics.timer :my_timer timer.update(500, :milliseconds) timer.update(5, :seconds) timer.update(4242, :nanoseconds) msec_timer = @metrics.timer :msec_timer, {:duration_unit => :microseconds, :rate_unit => :seconds} step = 0 # This is here so that we will run indefinitely so you can hit the # status page on localhost:8081/stats loop do sleep 1 modifier = rand(200).to_i step += 1 if (step % 2) modifier *= -1 end timer.update(500 + modifier, :microseconds) msec_timer.update(500 + modifier, :microseconds) end
Version data entries
12 entries across 12 versions & 2 rubygems