Class: Bosh::Monitor::GraphiteConnection
- Inherits:
-
TcpConnection
- Object
- EventMachine::Connection
- TcpConnection
- Bosh::Monitor::GraphiteConnection
- Defined in:
- lib/bosh/monitor/protocols/graphite_connection.rb
Constant Summary
Constants inherited from TcpConnection
TcpConnection::BACKOFF_CEILING, TcpConnection::MAX_RETRIES
Instance Attribute Summary
Attributes inherited from TcpConnection
Instance Method Summary collapse
-
#initialize(host, port) ⇒ GraphiteConnection
constructor
A new instance of GraphiteConnection.
- #send_metric(name, value, timestamp) ⇒ Object
Methods inherited from TcpConnection
#connection_completed, #increment_retries, #receive_data, #reset_retries, #retry_reconnect, #unbind
Constructor Details
#initialize(host, port) ⇒ GraphiteConnection
Returns a new instance of GraphiteConnection.
3 4 5 |
# File 'lib/bosh/monitor/protocols/graphite_connection.rb', line 3 def initialize(host, port) super("connection.graphite", host, port) end |
Instance Method Details
#send_metric(name, value, timestamp) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/bosh/monitor/protocols/graphite_connection.rb', line 7 def send_metric(name, value, ) if name && value && command = "#{name} #{value} #{}\n" @logger.debug("[Graphite] >> #{command.chomp}") send_data(command) else @logger.warn("Missing graphite metrics (name: '#{name}', value: '#{value}', timestamp: '#{}')") end end |