SnowAgent

Gem Version Build Status

Gem for sending metrics to SnowmanIO.

Installation

  1. Register new application in your SnowmanIO instance.
  2. Add gem 'snowagent' to application's Gemfile.
  3. Add two environments variables as described on 'Install' section of application

Example of installation instructions page:

Usage

The main goal of SnowmanIO is to collect low frequient business metrics and trends. So the agent supports only synchronous mode of sending metrics via HTTP/HTTPS.

It's strongly recomended don't send metric directly from request. Instead use cron tasks, delalyed jobs and other background processes to deliver metrics!

Code examples:

# In controller
SnowAgent.delay.increment("User Login")
SnowAgent.delay.increment("User Login", 1, user_id: user.id)

# In scheduled task
SnowAgent.time("Task Time") do
  # time consumed calculations
end

# Custom metric
SnowAgent.amount("Sessions Amount", Session.alive.count)

Testing

SNOWMANIO_SERVER=<server> SNOWMANIO_SECRET_TOKEN=<token> bundle exec ruby -e \
  'require "snowagent"; SnowAgent.increment("User Login", 1, user_id: 123)'

Contributing

  1. Implement a feature (remember about tests and CHANGELOG.md!)
  2. (optional) Suggest a blog mini post about new feature
  3. :snowman: will be happier