class Bosh::Monitor::GraphiteConnection

Public Class Methods

new(host, port) click to toggle source
Calls superclass method Bosh::Monitor::TcpConnection::new
# File lib/bosh/monitor/protocols/graphite_connection.rb, line 3
def initialize(host, port)
  super("connection.graphite", host, port)
end

Public Instance Methods

send_metric(name, value, timestamp) click to toggle source
# File lib/bosh/monitor/protocols/graphite_connection.rb, line 7
def send_metric(name, value, timestamp)
  if name && value && timestamp
    command = "#{name} #{value} #{timestamp}\n"
    @logger.debug("[Graphite] >> #{command.chomp}")
    send_data(command)
  else
    @logger.warn("Missing graphite metrics (name: '#{name}', value: '#{value}', timestamp: '#{timestamp}')")
  end
end