You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can we view the summary for each request in the k6 script (endpoint-wise summary)? Jmeter is offering this by default, we are looking for similar feature in k6 cli
The text was updated successfully, but these errors were encountered:
Is there any trick to make it work for all the requests by default, by writing some code main.js file? it looks I have to create one trend for each of my requests.
import { textSummary } from 'https://jslib.k6.io/k6-summary/0.0.1/index.js';
import http from 'k6/http';
import { htmlReport } from "https://raw.githubusercontent.com/benc-uk/k6-reporter/main/dist/bundle.js";
import { Trend } from 'k6/metrics';
export const options = {
"duration": "10s",
"vus": 1
};
let myRequestTrend = new Trend('myRequest')
export default function () {
let resp;
resp = http.get("https://jsonplaceholder.typicode.com/todos/1", {
tags: {
name: "getTodos",
},
});
myRequestTrend.add(resp.timings.duration)
http.get("https://jsonplaceholder.typicode.com/users", {
tags: {
name: "getUsers",
},
});
myRequestTrend.add(resp.timings.duration)
}
export const handleSummary = function (data) {
return {
'stdout': textSummary(data, { indent: ' ', enableColors: true }), // Show the text summary to stdout...
"summary.html": htmlReport(data),
'summary.json': JSON.stringify(data), // and a JSON with all the details...
}
}
Can we view the summary for each request in the k6 script (endpoint-wise summary)? Jmeter is offering this by default, we are looking for similar feature in k6 cli
The text was updated successfully, but these errors were encountered: