Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Instrumentation stack for Ruby EventMachine apps

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 spec Make labels configurable
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Guardfile
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 nosey.gemspec
README.md
          |     |
          |     |
         /       \
        ( __   __ )   Nosey - Realtime Ruby app instrumentation.
         '--'-;  ;
              |  |
        _     |  |
   __ /` ``""-;_ |
   \ '.;------. `\
    | |    __..  |
    | \.-''   _  |
    | |  ,-'-,   |
    |  \__.-'    |
     \    '.    /
      \     \  /
       '.      |
    jgs  )     |

Nosey is a way to instrument your Evented Ruby applications to track counts, aggregates, etc. It was built a Poll Everywhere because we need a way to peer into our Evented apps and grab some basic statistics so that we could graph on Munin. Since we needed this instrumentation available in several EM projects, we gathered the basics up into this gem.

Getting Started

Install the gem.

gem install nosey

Instrument your Ruby app with nosey.

require 'nosey'

class PandaBear
  include Nosey::Instrumentation

  def initialize
    nosey.touch 'started_at'
  end

  def growl(volume=1)
    nosey.touch 'last-growled-at'
    nosey.increment 'growl-count'
    nosey.avg 'growl-volume-avg', volume
    nosey.min 'growl-volume-min', volume
    nosey.max 'growl-volume-max', volume
    "G#{'r' * volume}!"
  end
end

princess = PandaBear.new
10.times {|n| princess.growl rand * 5 }
princess.nosey.report  # Soon to be a fantastico report, prolly in YML

When you fire Ruby this up, Nosey will open up a socket and report the stats.

$ cat /tmp/panda_bear.rb.socket

panda_bear.rb:
  started_at: 2011-09-13 23:21:52.530452000 -07:00
  last_growled_at: 2011-09-13 23:21:52.530452000 -07:00
  growls: 1

Thats the plan anyway. For now this is only going to work in EM, so its super handy if you're building EM servers and want to dump out the stats.

Something went wrong with that request. Please try again.