Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Statistics for Hector
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib/hector
test/lib
.gitignore
.gitmodules
LICENSE
README.md
Rakefile

README.md

hector-statsd is a Hector extension which sends statistics to a statsd server. You may configure custom statistics to accompany the following:

  • traffic.in -- All lines received by Hector
  • traffic.out -- All lines sent by Hector
  • connections -- The number of active connections
  • ssl_connections -- The number of active SSL connections (as a subset of connections)

hector-statsd works with any statsd client which responds to increment(stat_name) and decrement(stat_name), such as statsd-ruby.

Installation and usage

Install the hector-statsd gem and navigate to your server:

$ gem install hector-statsd
$ cd myserver.hect

Load hector-statsd in init.rb and configure it with a statsd client and namespace:

require "hector/statsd"
require "statsd"
Hector.statsd.client = Statsd.new("statsd.example.com", 8125)
Hector.statsd.namespace = "com.example.hector"

Track any Hector event with a custom statistic:

Hector.statsd.track "messages", :received_privmsg

You may also watch for a regex pattern in the response text. To keep track of people addressing Sam:

Hector.statsd.track "messages.sam", :received_privmsg, /^sam:/i

License (MIT)

Copyright © 2012 Ross Paffett.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.