Skip to content

cypriss/mouth-instrument

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mouth-instrument

Mouth-instrument is a very lightweight Ruby gem that you can use to instrument your apps to collect metrics. It sends these metrics via UDP to a mouth daemon for storage and analysis.

What is Mouth?

Mouth is a Ruby daemon that collects metrics via UDP and stores them in Mongo. It comes with a modern UI that allows you to view graphs and create dashboards of these statistics.

Using mouth-instrument

First, install the gem via your Gemfile or do so manually:

gem install mouth-instrument

Then, include it in your app:

require 'mouth-instrument'

Configure it to point to your daemon. In a Rails app, you might want to put this in config/initializers/mouth.rb

Mouth.daemon_hostport = "localhost:8889"

Then, instrument your app:

# Count things like this:
Mouth.increment("myapp.occurrences")          # Basic
Mouth.increment("myapp.occurrences", 10)      # Occurrences occurred 10 times!
Mouth.increment("myapp.occurrences", 1, 0.1)  # Sample at a 1/10 rate.  Lose a bit of accuracy, but sends less packets.  Good for super-high volume metrics.

# Measure timings like this:
Mouth.measure("myapp.happening") do
  do_happening!
end

# Or, like this (23.9 is in milliseconds):
Mouth.measure("myapp.happening", 23.9)

# Gauge values like this:
Mouth.gauge("myapp.subscriber_count", 1230) # I have 1230 customers right now!

View your metrics

Please see the Mouth project for more information! This gem plays a supporting role to core Mouth gem.

About

Instrument you ruby apps to send metrics to a mouth daemon

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages