关于Locust测试统计CSV文件字段及结果格式的技术咨询
Hey there! Let me break this down clearly for you regarding Locust's test statistics CSV files.
Locust's official docs do skip over some of the CSV fields, but the output follows a mostly consistent pattern—with small variations depending on your setup.
Core Standard Fields (Always Present in Most Tests)
These are the default fields you'll see in almost every Locust test CSV output:
Timestamp: The exact time the stats were loggedName: The name of the request/task (matches what you defined in your Locust script)Request Type: HTTP method likeGET,POST, etc.Response Time: Individual request response time (in milliseconds)Response Time Percentiles: Percentile values (e.g., 95th, 99th) — this changes based on which percentiles you configure for the testNumber of Requests: Total requests made in the time windowNumber of Failures: Total failed requests in the time windowMedian Response Time: Median response time (ms)Average Response Time: Average response time (ms)Min Response Time: Fastest response time recorded (ms)Max Response Time: Slowest response time recorded (ms)Average Content Size: Average size of the response payload (in bytes)Requests Per Second: RPS (requests per second) for the time window
Optional/Context-Dependent Fields
You might see these extra fields if you use specific Locust features or customizations:
User Count: Current number of active concurrent users (only if you have user count tracking enabled)Group: If you grouped your tasks/requests using thegroupparameter in@taskdecorators, this field marks which group the request belongs toException: Detailed error message for failed requests (e.g., connection timeouts, HTTP error code explanations)
Is There a "Standard Format"?
Locust doesn't have a rigid, unchangeable "official standard format" for CSV stats, but the core fields above are consistent across most versions and setups. Variations usually come from:
- Locust Version: Newer versions may add or rename fields (for example,
User Countwas added in a relatively recent update) - Custom Extensions: If you use third-party plugins or write custom stats logic in your script, you might see extra custom fields
- Test Configuration: If you specify custom percentiles (e.g., running
locust --percentiles 50 90 99), theResponse Time Percentilesfield will reflect those values
Quick tip: If your CSV has fields that don't match the core list above, check your Locust version first, then look for custom stats code in your test script or any plugins you're using.
内容的提问来源于stack exchange,提问作者cogitoergosum




