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 the Request File

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-03-10 22:20:39
A request file mainly refers to the files needed to build your request in a stress test scenario, such as the files to be uploaded in a stress test API. Users can directly operate these request files in the scenario.
For example:
The stress test scenario for Qzone users posting images requires simulating the scenario of users uploading images.
In some bank scenarios, certificates need to be installed on the client, and simulating these scenarios requires opening and loading the certificates on the client.

Use the Request File

1. Upload request file:



2. Use request file in script:
Code for defining global variables (global): It runs once per concurrency.
Code for the main function (default): It runs once per iteration for each concurrency, and each VU will continuously iterate until it reaches the duration limit or iteration limit configured in the current stress test.
Therefore, it is recommended to define some static file read operations in the global scope, as a single concurrency only needs to read the file once. Avoid defining file reads in the main function, as this will result in reading the file in each iteration, leading to performance loss in stress testing.
// send a post request
import http from "pts/http";

const makefile = open("Makefile");

export const options = {};

export default function main() {
let response;

response = http.post("https://httpbin.org/post", makefile, {
headers: {
"Content-Type": "application/octet-stream",
},
});
}
3. The open function provides two modes. If the second parameter is empty, it returns a string; if it is 'b', it returns an ArrayBuffer.
export default function main() {
let data = open('Makefile');
console.log(data); // SHELL := /bin/bash ...
data = open('Makefile', 'b');
console.log(data); // [object ArrayBuffer]
}


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백