Skip to content

Instantly share code, notes, and snippets.

@romcaname
romcaname / postman-response-time-metrics.js
Last active July 4, 2022 12:28
a postman script to calculate the response time average and standard deviation of a request
function standardDeviation(values, avg) {
var squareDiffs = values.map(value => Math.pow(value - avg, 2));
return Math.sqrt(average(squareDiffs));
}
function average(data) {
return data.reduce((sum, value)=>sum + value) / data.length;
}
if (responseCode.code === 200 || responseCode.code === 201) {