Function introduction
The plug-in is used to test the connection performance and message transmission performance of WebSocket/WSS services. Supports TCP/TLS handshake, WebSocket Upgrade, data sending, Ping/Pong heartbeat test, and can comprehensively evaluate the Network quality of WebSocket service.
| Parameter name | Required | Default value | Description |
|---|
url | yes | - | WebSocket URL, such as wss://www.example.com/ws |
host | no | null | Replace the domain name in the URL for resolution, in the format IP alias |
ipVersion | no | automatic | IP version: IPv6 forces IPv6, IPv4 forces IPv4, the name must be ipVersion |
dnsserver | no | null | Custom DNS server |
header | no | null | Customize the HTTP request header, which can be configured multiple lines |
data | no | null | Data content sent after successful WebSocket connection |
checkData | no | null | Response message verification rules after sending data |
pingCount | no | 0 | Ping/Pong heartbeat sending times. >0 to enable heartbeat testing, maximum 100 |
pingSize | no | 32 | Ping message payload size (bytes), maximum 65535 |
pingInterval | no | 100 | Ping message sending interval in milliseconds, maximum 5000 |
Output indicators
| Indicator index | Indicator name | unit | Calculation method |
|---|
| 0 | Total time spent | millisecond | The total time taken from the start of the task to the end of sending data via WebSocket (excluding Ping/Pong test time) |
| 1 | DNS Time | millisecond | Domain name resolution takes time |
| 2 | Connection Establishment Time | millisecond | TCP three-way handshake time consumption |
| 3 | SSL Handshake Time | millisecond | TLS handshake time (WSS time) |
| 4 | Upgrade time | millisecond | WebSocket HTTP Upgrade Request/Response time |
| 5 | Request sending time | millisecond | Time taken to send WebSocket data frame (settings data hours) |
| 6 | Time to First Byte (TTFB) | millisecond | The time taken from sending data to receiving the first server push (settings data hours) |
| 7 | Time to Last Byte | millisecond | Time consuming for subsequent data reception (settings data hours) |
| 8 | HTTP status code | - | HTTP status code of WebSocket Upgrade response, such as 101 |
| 9 | Ping Packet Loss Rate | % | (sent Ping count - received Pong count) / sent Ping count * 100 |
| 10 | Ping Min Latency | millisecond | Minimum round-trip delay for all successful Ping-Pongs |
| 11 | Ping Max Latency | millisecond | Maximum round-trip delay for all successful ping-pongs |
| 12 | Ping average latency | millisecond | Average round-trip latency of all successful Ping-Pongs |
The impact of parameters on output indicators
url: Determines the connection protocol (ws:// or wss://). WSS will generate additional SSL Handshake Time (Indicator 3); WS will have an additional SSL Handshake Time of 0.
pingCount:
- When it is 0, the heartbeat test is not performed and indicators 9-12 are not reported.
-
0, after the WebSocket connection is successful, the Ping frame is sent cyclically and waits for the Pong response to calculate the Packet Loss Rate and delay statistics.
pingInterval: Control Ping sending frequency. The smaller the value, the more intensive the Ping test will be, but the total time consuming may increase; the value that is too large may result in the specified number of Pings being unable to be completed within the timeout.
pingSize: Payload size of Ping frames. The WebSocket protocol stipulates that Ping/Pong can carry Application data, but some server implementations may ignore or not support large load Ping.
data: Data content sent after successful connection. If the server is in one-way push mode, settings are not required; if Request-response interactive mode is required, settings are required to trigger the server response.
checkData: used to verify the data content returned by the server. If the verification fails, the Error code is set, but it does not affect the Network performance index.
host: used to override HTTP Host header or SNI. settings this parameter when the URL uses an IP address but needs to specify a domain name for TLS handshake.
Workflow
- DNS resolution
- TCP connection establishment
- TLS handshake (when using WSS)
- Send WebSocket Upgrade HTTP request
- Wait for 101 Switching Protocols response
- Send user data (if settings data)
- Receive server push data
- Execute Ping/Pong test (if settings are pingCount)
- Close the connection and aggregate metrics
Error code
| Error code | meaning |
|---|
| 612702 | WebSocket upgrade failed (HTTP status codes <> 101 and < 400) |
| 612703 | WebSocket Ping loses all packets |
| 600xxx | HTTP status code >= 400 |
| 612xxx | Other standard errors |