0.0
No release in over 3 years
Low commit activity in last 3 years
Metrics based on ActiveSupport::Notifications
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 5.0
~> 0.11
~> 13.0
~> 0.15

Runtime

 Project Readme

ActiveMetrics

Gem Version Build Status Maintainability Test Coverage

A gem to simplify how metrics are being collected in Ruby-based applications.

As of now, the code is tested and optimized for usage on Heroku with the Librato add-on and all the metrics are collected via the application log.

Usage

Make sure that you start the collector somewhere in an initializer or before the you want to start collecting metrics:

ActiveMetrics::Collector.attach

Then include the module and then start collecting the metrics you want:

require 'active_metrics'

class Foo

  include ActiveMetrics::Instrumentable

  def bar
    count 'method.bar'
  end

end

Available methods:

  • count: add a value (default is 1) to a counter
  • measure: individual measurements that comprise a statistical distribution (i.e. latency measurements)
  • sample: simple key/numerical value pair

Be mindful of any kind of conflicts when including the module in your class.

Disabling the metrics

For various environments (development and QA), the metrics can be a bit too verbose and have very little value. In those cases, the metrics can be disabled using by using the SILENT_METRICS=1 environment variable.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/andreimaxim/active_metrics.

License

The gem is available as open source under the terms of the MIT License.