You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

关于Locust测试统计CSV文件字段及结果格式的技术咨询

Hey there! Let me break this down clearly for you regarding Locust's test statistics CSV files.

Locust测试统计CSV字段详情

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 logged
  • Name: The name of the request/task (matches what you defined in your Locust script)
  • Request Type: HTTP method like GET, 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 test
  • Number of Requests: Total requests made in the time window
  • Number of Failures: Total failed requests in the time window
  • Median 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 the group parameter in @task decorators, this field marks which group the request belongs to
  • Exception: 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:

  1. Locust Version: Newer versions may add or rename fields (for example, User Count was added in a relatively recent update)
  2. Custom Extensions: If you use third-party plugins or write custom stats logic in your script, you might see extra custom fields
  3. Test Configuration: If you specify custom percentiles (e.g., running locust --percentiles 50 90 99), the Response Time Percentiles field 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

火山引擎 最新活动