Browse Source

Reformat bandwidth data return section

pm2
Luke Childs 8 years ago
parent
commit
23ab68d9c1
  1. 4
      lib/bandwidth-chart.js

4
lib/bandwidth-chart.js

@ -25,15 +25,13 @@ function pointsFromBandwidthData(values, numPoints) {
}
// Return points
const result = points
return points
// Calculate average value of each point
.map(point => Math.round(point.reduce((a,b) => a + b) / point.length))
// Convert bytes to megabytes
.map(bytes => Number((bytes / 1000000).toPrecision(3)));
return result;
}
module.exports = values => {

Loading…
Cancel
Save