scaled-api-2000rps.json
Overview
The file **scaled-api-2000rps.json** is a structured JSON document that appears to represent performance testing results and metrics for an API system, likely collected from a load testing tool such as k6 or a similar framework. The file captures detailed aggregated statistics about HTTP request performance, throughput, error rates, and resource usage under a sustained load of approximately 2000 requests per second (RPS).
This file serves as a comprehensive snapshot of system behavior and performance characteristics during the test run and is designed for consumption by analysis tools or dashboards that visualize and interpret these metrics for further optimization and monitoring.
Detailed Explanation of the File Structure and Contents
The file is organized into several top-level sections:
1. root_group
Purpose: Represents the root grouping of tests or checks executed during the load test.
Structure:
groups: An empty array, indicating no nested subgroups in this test run.checks: An empty array, indicating no explicit pass/fail checks were recorded.name: An empty string, implying the root group has no specific name.path: An empty string.id: A unique identifier string, here a fixed MD5 hash of an empty string ("d41d8cd98f00b204e9800998ecf8427e").
*This section indicates that the test run aggregates under a single root grouping, but no further hierarchical grouping is utilized.*
2. options
Purpose: Contains configuration options used during the testing or output formatting.
Properties:
summaryTrendStats: An array defining which statistical measures to include in summary reports, including average (avg), minimum (min), median (med), maximum (max), and several percentiles (p(90),p(95),p(99)), pluscount.summaryTimeUnit: An empty string, suggesting the default time unit (likely milliseconds) is used.noColor: A boolean flag (false) indicating whether colored output was disabled (here colors are enabled).
3. state
Purpose: Captures the runtime state and environment conditions during the test.
Properties:
isStdOutTTY/isStdErrTTY: Booleans indicating if the standard output and error streams were TTY (interactive terminal).testRunDurationMs: Floating-point number indicating total duration of the test run in milliseconds (~314,823 ms or ~5.25 minutes).
4. metrics
Purpose: This is the core section containing detailed performance metrics collected during the test.
Structure: An object mapping metric names (strings) to metric data objects.
Each metric object contains:
type: The metric type, e.g.,"counter","rate","trend","gauge".contains: Indicates what the metric measures, e.g.,"time","default","data".values: An object with statistical values relevant to the metric (e.g.,avg,min,max, percentile values, counts, rates).thresholds: (Optional) A set of conditions evaluated against metric values, indicating pass/fail or OK status.
Key Metrics Description and Interpretation
Metric Name | Type | Description |
|---|---|---|
`data_sent` | counter | Total data sent in bytes and rate of data sent per second. |
`http_req_failed` | rate | Overall HTTP request failure rate including counts of passes and fails. |
`http_req_duration{status:200}` | trend | Timing statistics for successful HTTP requests (status 200). |
`iterations` | counter | Number of completed test iterations and their rate per second. |
`http_req_tls_handshaking` | trend | Timing statistics for TLS handshake duration. |
`http_req_blocked` | trend | Time spent blocked before sending the request (e.g., waiting for a free socket). |
`http_req_sending` | trend | Time spent sending the HTTP request to the server. |
`http_req_failed{scenario:account}` | rate | Failure rate specifically for the `account` scenario subset. |
`iteration_duration` | trend | Duration of each iteration cycle (including all requests and waits). |
`http_req_failed{scenario:utxos}` | rate | Failure rate specifically for the `utxos` scenario subset. |
`http_req_connecting` | trend | Time spent establishing TCP connections. |
`http_req_receiving` | trend | Time spent receiving the HTTP response from the server. |
`data_received` | counter | Total data received in bytes and rate of data received per second. |
`http_req_duration{expected_response:true}` | trend | Timing stats for requests with expected responses. |
`http_req_waiting` | trend | Time spent waiting for a response after sending the request (TTFB - time to first byte). |
`http_req_duration{scenario:account}` | trend | HTTP request duration statistics for the `account` scenario. |
`http_reqs` | counter | Total number of HTTP requests made and their rate. |
`http_req_duration` | trend | Overall HTTP request duration statistics (all requests). |
`vus` | gauge | Number of Virtual Users (concurrent users) active during the test. |
`vus_max` | gauge | Maximum number of Virtual Users active simultaneously. |
`dropped_iterations` | counter | Number and rate of iterations dropped (possibly due to timeouts or errors). |
`http_req_duration{scenario:utxos}` | trend | HTTP request duration statistics for the `utxos` scenario. |
Metrics Data Example
For the metric `"http_req_duration{status:200}"`:
{
"contains": "time",
"values": {
"med": 142.565183,
"max": 11028.95893,
"p(90)": 154.9876859,
"p(95)": 164.58481205,
"p(99)": 339.27252632,
"count": 581898,
"avg": 153.49071199455213,
"min": 133.162717
},
"thresholds": {
"max>=0": {
"ok": true
}
},
"type": "trend"
}
This indicates that for all HTTP requests that returned status 200:
Median duration was approximately 142.57 ms.
The slowest request took about 11 seconds (likely an outlier).
90th percentile at 155 ms, 95th at 164.6 ms, and 99th at 339 ms.
Total requests counted: 581,898.
Average duration: ~153.5 ms.
Threshold check
max >= 0passed successfully.
Important Implementation Details and Algorithms
Metric Types:
counter: Cumulative counts such as total requests, bytes sent/received.rate: Ratios or rates calculated over the test duration, e.g., failure rates.trend: Time-based metrics capturing distribution statistics (min, max, avg, median, percentiles).gauge: Instantaneous measurements such as concurrent virtual users.
Percentile Calculations:
Percentiles like
p(90),p(95), andp(99)represent the value below which that percentage of the samples fall, useful for understanding distribution tail behaviors.
Thresholds:
Defined thresholds serve as pass/fail criteria for each metric, enabling automated performance validations.
Scenario-Specific Metrics:
Metrics are segmented by scenarios such as
accountandutxos, each representing different test paths or functional flows within the API.
Interaction with Other System Components
This JSON file is a performance test result artifact generated by a load testing tool.
It interacts indirectly with:
Load Testing Engine: Generates and collects the data during execution.
Monitoring/Visualization Dashboards: Consumes this JSON to render reports, charts, and alerts.
CI/CD Pipelines: May be used as input for automated performance gatekeeping.
Application Under Test (API): The system whose performance characteristics are measured here.
In a modular software project, this file acts as a **data interchange artifact** to communicate test results between test execution and analysis/reporting stages.
Usage Example
To utilize this file, a developer or QA engineer might:
Load the JSON into a performance analysis tool or script.
Extract key metrics such as
http_req_failedrates orhttp_req_durationpercentiles.Compare against service-level objectives (SLOs) or thresholds.
Generate human-readable reports or charts for stakeholders.
Identify bottlenecks or error trends in specific scenarios (
account,utxos).Make informed decisions to optimize API performance or scale infrastructure.
Visual Diagram: Metrics Structure Flowchart
flowchart TD
A[scaled-api-2000rps.json]
A --> B[root_group]
A --> C[options]
A --> D[state]
A --> E[metrics]
E --> E1[data_sent (counter)]
E --> E2[http_req_failed (rate)]
E --> E3[http_req_duration (trend)]
E --> E4[iterations (counter)]
E --> E5[http_req_tls_handshaking (trend)]
E --> E6[http_req_blocked (trend)]
E --> E7[http_req_sending (trend)]
E --> E8[http_req_failed{scenario:account} (rate)]
E --> E9[iteration_duration (trend)]
E --> E10[http_req_failed{scenario:utxos} (rate)]
E --> E11[http_req_connecting (trend)]
E --> E12[http_req_receiving (trend)]
E --> E13[data_received (counter)]
E --> E14[http_req_duration{expected_response:true} (trend)]
E --> E15[http_req_waiting (trend)]
E --> E16[http_req_duration{scenario:account} (trend)]
E --> E17[http_reqs (counter)]
E --> E18[vus (gauge)]
E --> E19[vus_max (gauge)]
E --> E20[dropped_iterations (counter)]
E --> E21[http_req_duration{scenario:utxos} (trend)]
Summary
The **scaled-api-2000rps.json** file is a detailed, structured output from a load/performance testing process. It captures a variety of metrics related to request durations, failure rates, throughput, and resource usage. The file is instrumental for performance engineers and developers to analyze system behavior under high load conditions, identify performance bottlenecks, and validate that the API meets required service levels. The file’s schema supports flexibility for scenario-specific data and includes threshold checks for automated pass/fail evaluations. It integrates within a broader performance testing and monitoring ecosystem, feeding data into dashboards, reports, and CI/CD pipelines.
*End of Documentation*