Skip to content

Commit

Permalink
refactor: only need to delete once
Browse files Browse the repository at this point in the history
  • Loading branch information
hassy committed Aug 30, 2024
1 parent b56cbc5 commit 70008c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/artillery/lib/launch-platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,18 +376,18 @@ class Launcher {
);

// TODO: Track how many workers provided metrics in the metrics report
const stats = SSMS.mergeBuckets(this.metricsByPeriod[String(period)])[
String(period)
];
this.mergedPeriodMetrics.push(stats);
// summarize histograms for console reporter
// summarize histograms for console reporter:
const merged = SSMS.mergeBuckets(this.metricsByPeriod[String(period)]);
const stats = merged[String(period)];

stats.summaries = {};
for (const [name, value] of Object.entries(stats.histograms || {})) {
const summary = SSMS.summarizeHistogram(value);
stats.summaries[name] = summary;
delete this.metricsByPeriod[String(period)];
}

delete this.metricsByPeriod[String(period)];

this.periodsReportedFor.push(period);
this.pluginEvents.emit('stats', stats);
global.artillery.globalEvents.emit('stats', stats);
Expand Down

0 comments on commit 70008c5

Please sign in to comment.