vendor/bundle/ruby/2.1.0/gems/newrelic_rpm-3.9.4.245/lib/new_relic/agent/new_relic_service.rb
def build_metric_data_array(stats_hash)
        metric_data_array = []
        stats_hash.each do |metric_spec, stats|
          # Omit empty stats as an optimization
          unless stats.is_reset?
            metric_id = metric_id_cache[metric_spec]
            metric_data = if metric_id
              NewRelic::MetricData.new(nil, stats, metric_id)
            else
              NewRelic::MetricData.new(metric_spec, stats, nil)
            end
            metric_data_array << metric_data
          end
        end
        metric_data_array
      end
# The collector wants to recieve metric data in a format that's different
# from how we store it internally, so this method handles the translation.
# It also handles translating metric names to IDs using our metric ID cache.
The collector wants to recieve metric data in a format that's different
from how we store it internally, so this method handles the translation.
It also handles translating metric names to IDs using our metric ID cache.
The collector wants to recieve metric data in a format that ' s different from how we store it internally so this method handles the translation . It also handles translating metric names to IDs using our metric ID cache .
def build_metric_data_array(stats_hash)
        metric_data_array = []
        stats_hash.each do |metric_spec, stats|
          unless stats.is_reset?
            metric_id = metric_id_cache[metric_spec]
            metric_data = if metric_id
              NewRelic::MetricData.new(nil, stats, metric_id)
            else
              NewRelic::MetricData.new(metric_spec, stats, nil)
            end
            metric_data_array << metric_data
          end
        end
        metric_data_array
      end
def build_metric_data_array ( stats_hash ) metric_data_array = [ ] stats_hash . each do | metric_spec , stats | unless stats . is_reset? metric_id = metric_id_cache [ metric_spec ] metric_data = if metric_id NewRelic :: MetricData . new ( nil , stats , metric_id ) else NewRelic :: MetricData . new ( metric_spec , stats , nil ) end metric_data_array << metric_data end end metric_data_array end
The collector wants to recieve metric data in a format that's different
from how we store it internally, so this method handles the translation.
The collector wants to recieve metric data in a format that ' s different from how we store it internally so this method handles the translation .
# Omit empty stats as an optimization
stats_hash