-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
29 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export function getStressTestCsv(data: any) { | ||
let csv: string[] = ['scenario,avg,min,med,max,p(90),p(95)']; | ||
|
||
for (const metric in data['metrics']) { | ||
// Check if the metrics is a http_req_duration scenario | ||
if (metric.startsWith('http_req_duration') && metric.includes('scenario')) { | ||
const scenario = metric.split('{')[1].split('}')[0]; | ||
const values = data['metrics'][metric]['values']; | ||
|
||
const csvRow: string[] = [ | ||
scenario, | ||
values['avg'].toString(), | ||
values['min'].toString(), | ||
values['med'].toString(), | ||
values['max'].toString(), | ||
values['p(90)'].toString(), | ||
values['p(95)'].toString(), | ||
]; | ||
|
||
csv.push(csvRow.join(',')); | ||
} | ||
} | ||
|
||
return csv.join('\n'); | ||
} |