Project

metric

0.0
No commit activity in last 3 years
No release in over 3 years
Track metrics via metric.io
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme

Metric Build Status

Track simple metrics via metric.io.

Installation

Add the following anywhere in your Gemfile and run bundle install.

gem 'metric'

And create the following initializer:

Metric.configure do |config|
  config.api_key = "YOUR_API_KEY"
  config.secret_key = "YOUR_SECRET_KEY"
end

Now you are all set to start tracking some metrics!

Note: If you are using Rails it will only track events in Production mode.

Usage

You can track whatever metric you want, it will automatically show up in your dashboard.

Metric.track("article_view")

You can also add a custom amount to log multiple metrics in one go:

Metric.track("email_notifications", {:amount => 301})

If you want to push old statistics into metric.io you can use the date parameter:

Metric.track("signup", {:date => "20120101"})

To give the live event view in your dashboard some more context you can pass in meta information:

Metric.track("email", {:meta => "user 1021"})

Documentation

Although the code is pretty lightweight and self-explanatory, documentation is available via rdoc.info.

Thanks

jeffkreeftmeijer for providing me with the awesome domainname!