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

*This section indicates that the test run aggregates under a single root grouping, but no further hierarchical grouping is utilized.*


2. options


3. state


4. metrics

Each metric object contains:


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"
}

Important Implementation Details and Algorithms


Interaction with Other System Components

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:

  1. Load the JSON into a performance analysis tool or script.

  2. Extract key metrics such as http_req_failed rates or http_req_duration percentiles.

  3. Compare against service-level objectives (SLOs) or thresholds.

  4. Generate human-readable reports or charts for stakeholders.

  5. Identify bottlenecks or error trends in specific scenarios (account, utxos).

  6. 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*