Class: Bosh::Monitor::TsdbConnection
- Inherits:
-
TcpConnection
- Object
- EventMachine::Connection
- TcpConnection
- Bosh::Monitor::TsdbConnection
- Defined in:
- lib/bosh/monitor/protocols/tsdb_connection.rb
Constant Summary
Constants inherited from TcpConnection
Bosh::Monitor::TcpConnection::BACKOFF_CEILING, Bosh::Monitor::TcpConnection::MAX_RETRIES
Instance Attribute Summary
Attributes inherited from TcpConnection
Instance Method Summary collapse
-
#initialize(host, port) ⇒ TsdbConnection
constructor
A new instance of TsdbConnection.
- #send_metric(name, timestamp, value, tags = {}) ⇒ Object
Methods inherited from TcpConnection
#connection_completed, #increment_retries, #receive_data, #reset_retries, #retry_reconnect, #unbind
Constructor Details
#initialize(host, port) ⇒ TsdbConnection
Returns a new instance of TsdbConnection.
3 4 5 |
# File 'lib/bosh/monitor/protocols/tsdb_connection.rb', line 3 def initialize(host, port) super("connection.tsdb", host, port) end |
Instance Method Details
#send_metric(name, timestamp, value, tags = {}) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/bosh/monitor/protocols/tsdb_connection.rb', line 7 def send_metric(name, , value, = {}) = .map { |tag| tag.join("=") }.sort.join(" ") command = "put #{name} #{} #{value} #{}\n" @logger.debug("[TSDB] >> #{command.chomp}") send_data(command) end |