Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Metrics for ruby - a Ruby implementation of metrics inspired by @coda's JVM metrics for those of us in Ruby land
Ruby
tree: a8dbd9b1df

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
autotest
examples
lib
spec
.autotest
.gitignore
.rvmrc
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
ruby-metrics.gemspec

README.md

What is this?

This is a Ruby version of performance metrics inspired by metrics developed by Coda Hale at Yammer. Currently this is under heavy development -- it needs Gem packaging, more features, validation of metrics, more functional testing, and a little better test coverage. Pull requests happily accepted, please include docs and tests where possible!

What needs to be done?

Among other important things, this needs to be made more thread-safe. I'm currently looking at Mr. Nutter's ruby-atomic gem for making this less tedious but any suggestions are welcome!

What's in this?

Right now, I have:

  • Counters
  • Meters
  • Gauges
  • Histograms w/ uniform sampling
  • Histograms w/ exponentially decaying sampling

Upcoming:

  • Timers

Getting Started

The goal of ruby-metrics is to get up and running quickly. You start an agent, register some instruments, and they're exported over HTTP via JSON. For example, getting started with a counter would look like this:

@metrics = Metrics::Agent.new
@metrics.start

counter = @metrics.counter :my_counter
counter.incr
counter.incr

Then, hitting localhost:8001/status would yield:

{"my_counter":"2"}

License

Copyright 2011 John Ewart john@johnewart.net. Released under the MIT license. See the file LICENSE for further details.

Something went wrong with that request. Please try again.