JRuby application metric instrumentation using https://dropwizard.github.io/metrics.
You can create a metrics registry yourself, and create any metrics you want like this:
registry = Multimeter.create_registry
stuff = registry.counter('stuff')
timer = registry.timer('work')
stuff.inc
timer.time do
# do some heavy work
end
Ruby blocks can also be used to define gauges – metrics that proxy things that are counted by other means:
gague = registy.gauge('requests_per_second') do
some_object.requests_per_second
end
loop do
puts gauge.value
sleep 1
end