Class: HostedGraphite::Protocol
- Inherits:
-
Object
- Object
- HostedGraphite::Protocol
- Defined in:
- lib/hosted_graphite/protocol.rb
Constant Summary collapse
- HOST =
'carbon.hostedgraphite.com'.freeze
- API_URI =
'https://hostedgraphite.com/api/v1/sink'.freeze
- PORT =
2003.freeze
Instance Method Summary collapse
-
#initialize ⇒ Protocol
constructor
A new instance of Protocol.
- #send_metric(name, value, timestamp = nil) ⇒ Object
Constructor Details
#initialize ⇒ Protocol
Returns a new instance of Protocol.
9 10 11 12 |
# File 'lib/hosted_graphite/protocol.rb', line 9 def initialize fail MissingAPIKey unless HostedGraphite.api_key @api_key = HostedGraphite.api_key end |
Instance Method Details
#send_metric(name, value, timestamp = nil) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/hosted_graphite/protocol.rb', line 14 def send_metric(name, value, = nil) ((name, value, )) rescue => e # set HOSTEDGRAPHITE_DEBUG to to raise errors instead of silencing them. raise e if ENV['HOSTEDGRAPHITE_DEBUG'] 0 end |