Skip to content

Commit

Permalink
fix(speed): more accurate in speed statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
ElonH committed May 27, 2020
1 parent f0ea2d5 commit 324134d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/pages/jobs/speed-chart/speed-chart.component.ts
Expand Up @@ -165,10 +165,12 @@ export class SpeedChartComponent implements OnInit {
statsOut.subscribe((node) => {
if (node[1].length !== 0) return;
const time = moment();
const speed = node[0]['core-stats'].speed;
let avg = 0;
if (node[0]['core-stats'].transferring)
let speed = 0,
avg = 0;
if (node[0]['core-stats'].transferring) {
node[0]['core-stats'].transferring.forEach((x) => (avg += x.speedAvg));
node[0]['core-stats'].transferring.forEach((x) => (speed += x.speed));
}
const speedData = this.lineChartData[0].data as ChartPoint[];
const avgData = this.lineChartData[1].data as ChartPoint[];
const threadhold = time.clone().subtract(this.treadhold, 'seconds');
Expand Down

0 comments on commit 324134d

Please sign in to comment.