Class: Salus::GraphiteRenderer

Inherits:
BaseRenderer show all
Defined in:
lib/salus/renderer/graphite.rb

Instance Method Summary collapse

Methods inherited from BaseRenderer

descendants, inherited, #initialize, #iterate

Methods included from Logging

#log

Constructor Details

This class inherits a constructor from Salus::BaseRenderer

Instance Method Details

#render(data) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/salus/renderer/graphite.rb', line 3

def render(data)
  iterate(data) do |name, metric|
    # Text metrics are unsupported

    next if metric.is_a? Salus::Text
    # Nil value means nothing collected, so just ignore it

    unless metric.value.nil? || metric.timestamp.nil?
      STDOUT.puts "#{name} #{metric.value} #{metric.timestamp.to_i}"
    end
  end
end