Skip to content

Commit

Permalink
fix(summary): more accurate in speed statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
ElonH committed Jun 1, 2020
1 parent 5c3b532 commit c72d90a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/pages/jobs/summary/summary.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ export class SummaryComponent implements OnInit {
ngOnInit() {
this.stats$.getOutput().subscribe(([x, err]) => {
if (err.length !== 0) return;
let speed = 0;
if (this.values.transferring) {
this.values.transferring.forEach((x) => (speed += x.speed));
}
this.values = JSON.parse(JSON.stringify(x['core-stats']));
this.values.bytesHumanReadable = FormatBytes(this.values.bytes, 4);
this.values.speedHumanReadable = FormatBytes(this.values.speed, 4) + '/s';
this.values.speedHumanReadable = FormatBytes(speed, 4) + '/s';
this.values.durationHumanReadable = ForamtDuration.humanize(this.values.elapsedTime * 1000, {
language: 'shortEn',
round: true,
Expand Down

0 comments on commit c72d90a

Please sign in to comment.