We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4944dfa commit 640cb2cCopy full SHA for 640cb2c
k6/index.js
@@ -53,11 +53,20 @@ let group_durations = [...new Set(urls.map(url => url.group))]
53
return trends;
54
}, {});
55
56
+let group_sizes = [...new Set(urls.map(url => url.group))]
57
+ .reduce((trends, group) => {
58
+ trends[group] = new Trend(`http_res_body_size_${group}`, false);
59
+ return trends;
60
+ }, {});
61
+
62
export default function() {
63
const url = urls[exec.scenario.iterationInTest % urls.length]
64
const res = http.get(url.url);
65
check(res, {
66
'is status 200': (r) => r.status === 200,
67
});
68
group_durations[url.group].add(res.timings.duration);
69
70
+ const body_size = Math.round(parseInt(res.headers["Content-Length"]) / 10.24) / 100;
71
+ group_sizes[url.group].add(body_size);
72
}
0 commit comments