Class: Notify::Graphite
- Inherits:
- BasicObject
- Defined in:
- lib/notify/graphite.rb
Constant Summary collapse
- VERSION =
"0.0.2"
Instance Method Summary collapse
-
#initialize(host, port = 2003, basename = nil) ⇒ Graphite
constructor
A new instance of Graphite.
- #send_event(event_name) ⇒ Object
Constructor Details
#initialize(host, port = 2003, basename = nil) ⇒ Graphite
Returns a new instance of Graphite.
38 39 40 41 |
# File 'lib/notify/graphite.rb', line 38 def initialize(host, port=2003, basename=nil) @basename = ["events", basename].compact.join('.') @client = ::CarbonClient.new(host+":"+port.to_s) end |
Instance Method Details
#send_event(event_name) ⇒ Object
43 44 45 46 |
# File 'lib/notify/graphite.rb', line 43 def send_event(event_name) @client.sendMetric(@basename+"."+event_name, 1) #TODO: we should also send a "normal" graphite event to the json api. end |