Sha256: 66d154a73f1c11c78c5100b4714739e8137f37e4984dcdd22fa61d87d30f03ce

Contents?: true

Size: 1.42 KB

Versions: 4

Compression:

Stored size: 1.42 KB

Contents

# Metric [![Build Status](https://secure.travis-ci.org/bittersweet/metric.png)](http://travis-ci.org/bittersweet/metric)

Track simple metrics via [metric.io](metric.io).

## Installation

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

``` ruby
gem 'metric'
```

And create the following initializer:

``` ruby
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.

``` ruby
Metric.track("article_view")
```

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

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

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

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

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

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

## Documentation

Although the code is pretty lightweight and self-explanatory,
[documentation](http://rdoc.info/github/bittersweet/metric/master/frames)
is available via rdoc.info.

## Thanks

[jeffkreeftmeijer](https://github.com/jeffkreeftmeijer) for providing me with
the awesome domainname!

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
metric-0.1.2 README.markdown
metric-0.1.1 README.markdown
metric-0.1.0 README.markdown
metric-0.0.9 README.markdown