tencent cloud

Tencent Cloud Observability Platform

Release Notes and Announcements
Release Notes
Product Introduction
Overview
Strengths
Basic Features
Basic Concepts
Use Cases
Use Limits
Purchase Guide
Tencent Cloud Product Monitoring
Application Performance Management
Mobile App Performance Monitoring
Real User Monitoring
Cloud Automated Testing
Prometheus Monitoring
Grafana
EventBridge
PTS
Quick Start
Monitoring Overview
Instance Group
Tencent Cloud Product Monitoring
Application Performance Management
Real User Monitoring
Cloud Automated Testing
Performance Testing Service
Prometheus Getting Started
Grafana
Dashboard Creation
EventBridge
Alarm Service
Cloud Product Monitoring
Tencent Cloud Service Metrics
Operation Guide
CVM Agents
Cloud Product Monitoring Integration with Grafana
Troubleshooting
Practical Tutorial
Application Performance Management
Product Introduction
Access Guide
Operation Guide
Practical Tutorial
Parameter Information
FAQs
Mobile App Performance Monitoring
Overview
Operation Guide
Access Guide
Practical Tutorial
Tencent Cloud Real User Monitoring
Product Introduction
Operation Guide
Connection Guide
FAQs
Cloud Automated Testing
Product Introduction
Operation Guide
FAQs
Performance Testing Service
Overview
Operation Guide
Practice Tutorial
JavaScript API List
FAQs
Prometheus Monitoring
Product Introduction
Access Guide
Operation Guide
Practical Tutorial
Terraform
FAQs
Grafana
Product Introduction
Operation Guide
Guide on Grafana Common Features
FAQs
Dashboard
Overview
Operation Guide
Alarm Management
Console Operation Guide
Troubleshooting
FAQs
EventBridge
Product Introduction
Operation Guide
Practical Tutorial
FAQs
Report Management
FAQs
General
Alarm Service
Concepts
Monitoring Charts
CVM Agents
Dynamic Alarm Threshold
CM Connection to Grafana
Documentation Guide
Related Agreements
Application Performance Management Service Level Agreement
APM Privacy Policy
APM Data Processing And Security Agreement
RUM Service Level Agreement
Mobile Performance Monitoring Service Level Agreement
Cloud Automated Testing Service Level Agreement
Prometheus Service Level Agreement
TCMG Service Level Agreements
PTS Service Level Agreement
PTS Use Limits
Cloud Monitor Service Level Agreement
API Documentation
History
Introduction
API Category
Making API Requests
Monitoring Data Query APIs
Alarm APIs
Legacy Alert APIs
Notification Template APIs
TMP APIs
Grafana Service APIs
Event Center APIs
TencentCloud Managed Service for Prometheus APIs
Monitoring APIs
Data Types
Error Codes
Glossary

Use a Parameter File

PDF
Focus Mode
Font Size
Last updated: 2025-03-10 22:20:38

Upload Parameter File

By uploading a CSV parameter file, you can dynamically reference the test data within for use with variables in your scripts.
This way, when the load generator executes this code concurrently, each request can dynamically fetch each row of data from the CSV file to use as request parameters.
Parameter Definition:
The first line of the default CSV is used as the parameter name. In this mode, when PTS reads data, it will skip the first line.
If you don't use the first line of the CSV file as the parameter name, you can uncheck "First Line as Parameter Name" as shown below, then check the row where the parameter file is located, and a parameter name editing box will expand on the page for you to edit the parameter name yourself.



Parameter Usage:
In the code, you can use the parameter name as the variable name to obtain the variable value.
Each VU takes a row of data from the CSV in sequence with each iteration.
After the last row of data in the csv file is read, it will go back to the first row and continue to read in a loop next time.
Combination and Splitting of Parameter Files :
If the stress test concurrency is high, you can check "split file" to split the large file and distribute it to each load generator for use.
Multiple csv parameter files can be uploaded in one scenario for cross-file parameter combination.
Column names (parameter names) in different csv files need to be globally unique.
If different csv files have different row counts, the one with the larger row count is used as the benchmark by default, and the csv file with fewer rows will be automatically replicated to match the row count of the benchmark file, ensuring that the data for each VU iteration is predictable.

Use Parameter File

Simple Mode Scenario

In simple mode scenarios, you can use parameters from the parameter file in the form of ${}.
Take the following dataset.csv as an example:
MyKey,MyValue
key1,value1
key2,value2
After the upload is complete, it will look as shown below:




Script Mode Scenario

The example code is as follows: Use dataset.get("MyKey") to obtain the parameter value for the parameter name/column name MyKey from the CSV file, which serves as the value in the request body.
import dataset from 'pts/dataset';

export default function () {
const value = dataset.get("MyKey")
//@ts-ignore
const postResponse = http.post("http://httpbin.org/post", {data: value});
console.log(postResponse)
};


Help and Support

Was this page helpful?

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

Feedback