tencent cloud

Tencent Cloud Observability Platform

pts.step

PDF
Focus Mode
Font Size
Last updated: 2025-03-11 19:41:13
During the script execution, divide the process into different steps, and distinguish these steps in the final performance testing report.
step(name: string, callback: (() => void));

Parameters

Parameter
Type
Description
name
string
The information for identifying the name of the step.
callback
function
The function executed within the step, consisting of script statements that need to be executed.

Samples

Divide the script execution process into multiple steps:
import http from 'pts/http';
import { step } from 'pts';

export default function () {
step('get1', function () {
http.get('http://httpbin.org/get');
})
step('get2', function () {
http.get('http://httpbin.org/get');
})
step('get3', function () {
http.get('http://httpbin.org/get');
})
};


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback