lib/providers/metrics-provider.js
function getInitializedAverage(data) {
    return _.reduce(data, function (prev, a, dataKey) {
      // create a first-level object of the key
      prev[dataKey] = {};

      _.each(data[dataKey], function (b, dataMetricKey) {
        // the metrics are properties inside this object
        prev[dataKey][dataMetricKey] = 0;
      });

      return prev;
    }, {});
  }
function getInitializedAverage(data) {
    return _.reduce(data, function (prev, a, dataKey) {
      // create a first-level object of the key
      prev[dataKey] = {};

      _.each(data[dataKey], function (b, dataMetricKey) {
        // the metrics are properties inside this object
        prev[dataKey][dataMetricKey] = 0;
      });

      return prev;
    }, {});
  }
function getInitializedAverage ( data ) { return _ . reduce ( data , function ( prev , a , dataKey ) { // create a first-level object of the key prev [ dataKey ] = { } ; _ . each ( data [ dataKey ] , function ( b , dataMetricKey ) { // the metrics are properties inside this object prev [ dataKey ] [ dataMetricKey ] = 0 ; } ) ; return prev ; } , { } ) ; }
Given a metric data object, construct an initialized average.

@param {Object} data
The metric data received.

@returns {Object}
The initialized average object is returned.
Given a metric data object construct an initialized average .