lib/puppet/reports/wavefront.rb
# Turn the `metrics` object which Puppet gives us into actual
# Wavefront points.
# @return [Array] points ready to be pushed to Wavefront.
#
Turn the `metrics` object which Puppet gives us into actual
Wavefront points.
Turn the ` metrics ` object which Puppet gives us into actual Wavefront points .
def metrics_as_points
    ts = Time.now.to_i
    metrics.each_with_object([]) do |(category, metric), aggr|
      metric.values.each do |v|
        aggr.<< ({ path:  [PATH_BASE, category, v[0]].join('.'),
                   value: v[2],
                   ts:    ts })
      end
    end
  end
def metrics_as_points ts = Time . now . to_i metrics . each_with_object ( [ ] ) do | ( category , metric ) , aggr | metric . values . each do | v | aggr . << ( { path : [ PATH_BASE , category , v [ 0 ] ] . join ( '.' ) , value : v [ 2 ] , ts : ts } ) end end end
Turn the `metrics` object which Puppet gives us into actual
Wavefront points.
Turn the ` metrics ` object which Puppet gives us into actual Wavefront points .
points ready to be pushed to Wavefront.
points ready to be pushed to Wavefront .
Array