result-api-scaled-1-500rps.json
Overview
`result-api-scaled-1-500rps.json` is a performance test results data file representing the output of a load testing run, likely from a tool such as [k6](https://k6.io/) or a similar HTTP load testing framework. The file stores metrics collected under a scenario that simulates API requests scaled linearly from 1 to 500 requests per second (RPS).
This JSON file captures detailed statistical summaries of HTTP request durations, failure rates, iteration durations, virtual user (VU) counts, and data transfer volumes. These metrics are essential for analyzing the behavior, performance, and reliability of an API under high load conditions.
Detailed Structure and Explanation
This file does **not** contain classes or functions as it is a data file (JSON), but it organizes information into several key sections:
1. root_group
Purpose: Defines a top-level grouping of test checks or nested groups.
Properties:
groups: An array of sub-group objects (empty here).checks: An array of test checks (empty here).name: Name of the group (empty string here).path: Path identifier (empty string here).id: Unique identifier string (MD5 hash of empty string in this case).
2. options
Purpose: Configuration options related to summary reporting.
Properties:
summaryTrendStats: Array of statistical measures included in trend summaries (e.g., "avg", "min", "p(90)", "count").summaryTimeUnit: Unit of time for summaries (empty string here indicates default).noColor: Boolean flag indicating whether color output is disabled (false here).
3. state
Purpose: Metadata about the test runtime environment.
Properties:
isStdOutTTY: Boolean indicating if standard output is a terminal.isStdErrTTY: Boolean indicating if standard error is a terminal.testRunDurationMs: Total duration of the test run in milliseconds (~301,855 ms or ~5 minutes).
4. metrics
Purpose: Core performance metrics collected during the test run.
Structure: A dictionary keyed by metric names, each containing:
type: The metric type (trend,counter,rate,gauge).contains: Category or unit type (e.g., "time", "data", "default").values: Statistical data or counts.Optional:
thresholdsindicating pass/fail criteria for performance goals.
Key Metrics Explained
Metric Name | Type | Description |
|---|---|---|
`http_req_duration` | trend | Duration of HTTP requests in milliseconds with statistics like avg, min, median, max, percentiles. |
`http_req_failed{scenario:rps}` | rate | Failure rate of requests in the "rps" scenario, with counts of passes and fails. |
`iteration_duration` | trend | Duration of each test iteration (virtual user cycle) in milliseconds with detailed stats. |
`http_req_duration{status:200}` | trend | HTTP request durations filtered by HTTP 200 status responses. |
`http_req_duration{scenario:rps}` | trend | HTTP request durations filtered by the "rps" scenario. |
`http_req_blocked` | trend | Time spent blocked before sending HTTP requests. |
`http_req_tls_handshaking` | trend | Time spent on TLS handshake during requests. |
`http_req_duration{expected_response:true}` | trend | Duration of requests where the expected response was received. |
`data_sent` | counter | Total amount of data sent in bytes and rate. |
`http_req_receiving` | trend | Time spent receiving HTTP response data. |
`vus_max` | gauge | Maximum number of virtual users during the test. |
`http_req_sending` | trend | Time spent sending HTTP request data. |
`data_received` | counter | Total amount of data received in bytes and rate. |
`http_req_waiting` | trend | Time spent waiting for a response from the server (TTFB). |
`vus` | gauge | Number of virtual users during the test. |
`http_reqs` | counter | Total number of HTTP requests sent and rate. |
`http_req_failed` | rate | Overall HTTP request failure rate. |
`dropped_iterations` | counter | Number of test iterations dropped due to system constraints. |
`iterations` | counter | Total iterations completed and rate. |
`http_req_connecting` | trend | Time spent establishing TCP connections. |
Usage of Metrics (Example)
To analyze the API's responsiveness under load, a performance engineer can:
Check
http_req_duration{scenario:rps}percentiles to identify latency spikes.Validate
http_req_failed{scenario:rps}rate to ensure failure rates remain below acceptable thresholds (e.g.,rate < 0.01).Review
vus_maxandvusvalues to confirm the number of concurrent virtual users.Monitor
dropped_iterationsto detect if the system drops any iterations due to overload.
Important Implementation Details
Percentiles (p(90), p(95), p(99)): These indicate the latency below which 90%, 95%, and 99% of the requests fall, respectively, providing insight into worst-case performance.
Thresholds: Conditions like
"p(95) < 800"or"rate<0.01"are used to assert whether the performance goals are met.Trend metrics: Offer statistical trends over time rather than just raw counts.
Rate metrics: Express ratios such as failure rates or success rates.
Counter metrics: Provide cumulative counts (e.g., number of requests or bytes).
Gauge metrics: Snapshot values representing instantaneous states like active VUs.
Interaction with Other Parts of the System
This file is typically produced by a load testing tool during or after an execution run.
It is consumed by reporting or analysis modules that parse these metrics to generate human-readable reports or dashboards.
May integrate with CI/CD pipelines to enforce performance gates by validating thresholds.
Used by developers and performance engineers to identify bottlenecks, regressions, or failures in the API under various RPS loads.
Can be archived for historical comparison of performance trends over time.
Visual Diagram: Flowchart of Metrics Structure
flowchart TD
A[Metrics] --> B[Trend Metrics]
A --> C[Rate Metrics]
A --> D[Counter Metrics]
A --> E[Gauge Metrics]
B --> B1["http_req_duration"]
B --> B2["iteration_duration"]
B --> B3["http_req_blocked"]
B --> B4["http_req_tls_handshaking"]
B --> B5["http_req_duration{status:200}"]
B --> B6["http_req_duration{scenario:rps}"]
B --> B7["http_req_receiving"]
B --> B8["http_req_sending"]
B --> B9["http_req_waiting"]
B --> B10["http_req_connecting"]
C --> C1["http_req_failed"]
C --> C2["http_req_failed{scenario:rps}"]
D --> D1["http_reqs"]
D --> D2["data_sent"]
D --> D3["data_received"]
D --> D4["dropped_iterations"]
D --> D5["iterations"]
E --> E1["vus"]
E --> E2["vus_max"]
Summary
This JSON file is a comprehensive snapshot of load test metrics for an API under a scaled load scenario (1 to 500 RPS). It captures detailed timing, success/failure rates, data throughput, and virtual user counts, enabling deep performance analysis and validation against defined thresholds.
By understanding and interpreting these metrics, stakeholders can make informed decisions about API scalability, optimize bottlenecks, and ensure reliable user experiences under high loads.