getAveragedAggregate
      = function getAveragedAggregate(rows, startIndex, endIndex) {
        const averagedAggregate = getInitializedAverage(metricData);

        // this is the number of elements we will aggregate
        const aggregateCount = endIndex - startIndex + 1;

        // you can compute an average of a set of numbers two ways
        // first, you can add all the numbers together and then divide by the count
        // second, you call divide each number by the count and add the quotients
        // the first method is more accurate, however you can overflow an accumulator
        // and result with NaN
        // the second method is employed here to ensure no overflows

        for (const dataKey in metricData) {
          for (const dataMetricKey in metricData[dataKey]) {
            for (let rowIndex = startIndex; rowIndex <= endIndex; rowIndex++) {
              averagedAggregate[dataKey][dataMetricKey]
                += rows[rowIndex][dataKey][dataMetricKey] / aggregateCount;
            }

            // after the average is done, truncate the averages to one decimal point
            averagedAggregate[dataKey][dataMetricKey]
              = Number(averagedAggregate[dataKey][dataMetricKey].toFixed(1));
          }
        }

        return averagedAggregate;
      }
After having detected a new sampling, aggregate the relevant data points

@param {Object[]} rows
The array reference.

@param {Number} startIndex
The starting index to derive an average.

@param {Number} endIndex
The ending index to derive an average.

@returns {void}