|
|
Posted on 2025-3-17 15:31:01
|
|
|
|

Requirements: Stress test the interface using K6.
review
k6 tool
The K6 is a modern load testing tool built on our years of experience in the performance and test industry. It's powerful, scalable, and feature-packed. Its main design goal is to provide the best developer experience.
Its core features are:
Configurable load generation. Even low-end machines can simulate large volumes of traffic. Test as code. Reuse scripts, modular logic, version control, and integrate tests with CI. Full-featured API. The Scripting API includes a variety of features to help you simulate real application traffic. Embedded JavaScript engine. Go performance, JavaScript script familiarity. Multi-protocol support. HTTP, WebSockets, gRPC, browsers, etc. Large scaling ecosystem. You can extend the k6 to meet your needs. Many have already shared their expansions with the community! Flexible metrics storage and visualization. Aggregate statistics or fine-grained metrics and export them to the service of your choice. Native integration with Grafana cloud. SaaS solutions for test execution, metric correlation, data analysis, and more.
This is load testing for the 21st century.
Documentation:The hyperlink login is visible. Source code address:The hyperlink login is visible. Download for Windows:The hyperlink login is visible.
Test
Create a new test.js configuration script with the following code:
Run the test, command:
Output detailed explanation
- scenarios: Briefly describe the running of the test script; Describe how many test cases, the largest number of virtual users, and the maximum run duration.
- data_received: The amount of data received
- data_sent: The amount of data sent
- http_req_blocked: The time that was blocked before initiating the request
- http_req_connecting: The time taken to establish a TCP connection to the remote host
- http_req_duration: The total time of the request. It equals http_req_sending + http_req_waiting + http_req_receiving important metrics
- http_req_failed: Failed request rate
- http_req_receiving: Time taken to receive response data from the remote host without initial DNS lookup/connection time
- http_req_sending: The time it takes to send data to the remote host
- http_req_tls_handshaking: The time it takes to establish a TLS session by shaking hands with the remote host
- http_req_waiting: The time spent waiting for the remote host to respond
- http_reqs: The total number of requests TPS
- iteration_duration: The time it takes to complete a full iteration of the default/main function
- iterations: The number of times a function in a script is executed
- vus: The number of virtual users that are currently active
- vus_max: The maximum number of virtual users
- checks: The success rate of the checks item
The output results are supported: Amazon CloudWatch, Cloud, CSV, Datadog, Dynatrace, Elasticsearch, Grafana Cloud Prometheus, InfluxDB, JSON, Netdata, New Relic, Prometheus, TimescaleDB, StatsD, reference:The hyperlink login is visible. |
Previous:.NET/C# uses the SM3 algorithm to generate signaturesNext:NVIDIA DGX Spark, the NVIDIA AI supercomputer, is accepting pre-orders
|