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
Instance Method Details
#api_key ⇒ Object
9 10 11 |
# File 'lib/hosted_graphite/protocol.rb', line 9 def api_key HostedGraphite.api_key end |
#send_metric(name, value, timestamp = nil) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/hosted_graphite/protocol.rb', line 13 def send_metric(name, value, = nil) raise MissingAPIKey unless api_key ((name, value, )) rescue MissingAPIKey => e raise e rescue => e # set HOSTEDGRAPHITE_DEBUG to to raise errors instead of silencing them. raise e if ENV['HOSTEDGRAPHITE_DEBUG'] 0 end |