New to K6, following online documentation. Unsuccessful in grouping dynamic request tag given in code not appearing in any of summary report generated, what cane going wrong?
import http from 'k6/http';
import { htmlReport } from "https://raw.githubusercontent.com/benc-uk/k6-reporter/main/dist/bundle.js";
import { jUnit, textSummary } from 'https://jslib.k6.io/k6-summary/0.0.1/index.js';
export function handleSummary(data) {
return {
"result.html": htmlReport(data),
'stdout': textSummary(data, { indent: ' ', enableColors: true }), // Show the text summary to stdout...
'junit.xml': jUnit(data), // but also transform it and save it as a JUnit XML...
'summary.json': JSON.stringify(data),
};
}
export default function () {
var params = {tags: {name: "Getting something from api"},};
for (let id = 1; id <= 50; id++) {
/*http.get(`http://example.com/posts/${id}`, {
tags: { name: 'PostsItemURL' },
});*/
http.get(`http://example.com/posts/${id}`,params);
check(res, { 'status was 200': (r) => r.status == 200 });
/// any of the other onse
}
}