What is the behaivour of Trend Metric in for or while loop?

export const options = {
    summaryTimeUnit: 'ms',
    scenarios: {
        CreatePicking: {
            exec: 'CreatePicking',
            executor: 'per-vu-iterations',
            vus: 1,
            iterations: 1

When I use metrics in a loop, what is the behaivour? Does the timing.duration increase for every loop? Or just calculates one time?

 while (createdIsCompleted == false) {    // it will returns 3 time

            let checkCellRes = http.post(requestUrlAPI + 'testCell', JSON.stringify({
                cellText: `${cellClear}`,
            }), generateTokenHeader)


Hi @Yusuf,
checkCellRes.timings.duration will be the duration (in ms) of only the request that you just made.

checkCellTrend (which I guess is a trend given the name :wink: ) will accumulate all the values and in the end summary (for example) will show you min/max/avg/med values + some percentile values based on all the values that were added.

Does this answer your question?

If not can you give a concrete example, with numbers, that is confusing for you or you want to understand how it will behave.

Thanks , this is the correct answer for me :innocent: