Hi, I am not sure where to get the average response time and the value of other metrics (p95, min, max,med,p90) of some selected endpoints/request only in a script (not all request are to be included)
I am using 3 methods:
1. I added tags for the selected requests so I can view their metric statistics values in the local summary results. See Thresholds
Ex:
**thresholds:** {
'http_req_duration{type:API}': ['p(95)<=50000'],
//http_req_failed: ['rate<=0.01'], // http errors should be less than or equal to 1%
},
export default function main() {
response = http.get (https://google.com), {
headers: {
Authorization: abcdeghi
}
tags: { type: 'API' },
});
response = http.post(https://friends.com), {
headers: {
Authorization: abcdeghi
}
tags: { type: 'API' },
});
Local Summary Result:
- I also placed those selected requests in a group so I can view their metric statistics values in the k6 cloud.
Ex:
**thresholds:** {
'http_req_duration{type:API}': ['p(95)<=some number here'],
//http_req_failed: ['rate<=0.01'], // http errors should be less than or equal to 1%
},
export default function main() {
group('Log In - View Home Page', function () {
response = http.get (https://google.com), {
headers: {
Authorization: abcdeghi
}
tags: { type: 'API' },
});
response = http.post(https://friends.com), {
headers: {
Authorization: abcdeghi
}
tags: { type: 'API' },
});
});
k6 Cloud Result:
- Since I placed them in groups, I also defined that group in the threshold so their metric statistics values will be displayed in the local summary results. See Thresholds
Ex:
**thresholds:** {
'http_req_duration{type:API}': ['p(95)<=some number here'],
'group_duration{group:::Log In - View Home Page}': ['avg <= some number here'],
},
export default function main() {
group('Log In - View Home Page', function () {
response = http.get (https://google.com), {
headers: {
Authorization: abcdeghi
}
tags: { type: 'API' },
});
response = http.post(https://friends.com), {
headers: {
Authorization: abcdeghi
}
tags: { type: 'API' },
});
});
Local Summary Result:
What should I use or to where should I refer to between these 3?
Thanks