Statsman
Send stats to a cupboard backend
Installation
Add this line to your application's Gemfile:
gem 'statsman'
And then execute:
$ bundle
Or install it yourself as:
$ gem install statsman
Usage
Rails
In an initializer:
# config/initializers/statsman.rb
Statsman.config do |config|
#config.logging_on = false # stealth by default
config.api_key = "your-api-key"
config.api_secret = "your-api-secret"
config.url = "http://url-of-cupboard-backend"
end
Then, whereever you want to collect stats:
# Send a counter stat
Statsman.send_counter "my-counter-stat-name", some_count, { optional: "metadata" }
# Send a value stat
Statsman.send_value "my-value-stat-name", some_value, { optional: "metadata" }
Troubleshooting
If Statsman doesn't appear to be working, be sure to turn on logging.
TODO
- Thread pool?
Contributing
- Fork it ( https://bitbucket.org/7compass/statsman/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request