UNPKG
k6-test-framework
Version:
latest (1.0.0)
1.0.0
Enterprise-grade load testing solution with k6
k6-test-framework
/
report
/
metricsCollector.js
7 lines
(6 loc)
•
255 B
JavaScript
View Raw
1
2
3
4
5
6
7
// report/metricsCollector.js
export
const
collectMetrics
= (
testResults
) => ({
requests
: testResults.
length
,
successRate
: testResults.
filter
(
(
r
) =>
r.
success
).
length
/ testResults.
length
,
responseTimes
: testResults.
map
(
(
r
) =>
r.
latency
), });