Skip to content
Novus Examples
json1.5 KB

Performance Budget — Page and API Limits (JSON)

A budget file pairing per-path resource-size and timing limits with API latency budgets, including a glob path that must be matched rather than compared for equality. It is the configuration side of the load-test results in this group: the limits a run is judged against.

Preview — first 50 linesjson
{
  "$comment": "Performance budget for the fictional Novus Checkout Service.",
  "budgets": [
    {
      "path": "/cart",
      "resourceSizes": [
        {
          "resourceType": "script",
          "budgetKb": 180
        },
        {
          "resourceType": "stylesheet",
          "budgetKb": 60
        },
        {
          "resourceType": "image",
          "budgetKb": 320
        },
        {
          "resourceType": "total",
          "budgetKb": 700
        }
      ],
      "resourceCounts": [
        {
          "resourceType": "third-party",
          "budget": 4
        }
      ],
      "timings": [
        {
          "metric": "first-contentful-paint",
          "budgetMs": 1800
        },
        {
          "metric": "largest-contentful-paint",
          "budgetMs": 2500
        },
        {
          "metric": "interactive",
          "budgetMs": 3800
        },
        {
          "metric": "cumulative-layout-shift",
          "budget": 0.1
        }
      ]
    },
    {
      "path": "/checkout/*",
78 lines total — download for the full file.

Specifications

Seed
61200
Path Budgets
2
Resource Types
5
Timing Metrics
4
Api Routes
2
Has Glob Path
true
Line Endings
LF

Testing contract

Reference control
Scenario
Match a measured page or route against the budget entry that governs it.
Expected result
/checkout/payment matches the /checkout/* budget with a 500 KB total limit, and GET /v1/cart is held to a p95 of 250 ms.

What is a .json file?

JSON (JavaScript Object Notation) is a lightweight, text-based data-interchange format representing objects, arrays, strings, numbers, booleans, and null. It is language-independent, human-readable, and the dominant format for web APIs and configuration. It requires a single well-formed root value.

How to use this file

Use an example JSON file to test parsers and serializers, schema validation, Unicode and number-precision handling, and API request or response processing.

How to use this file for testing

“Performance Budget — Page and API Limits (JSON)” is a deterministic Novus Examples fixture for Performance testing, Config parsing, JSON parsing. Documented size, row-count, duration, and resolution ladders for measuring parser, renderer, converter, and upload performance without relying on private production data.

Documented properties for this file: seed 61200 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Test and coverage reports document their totals (suites, cases, passes, failures, skips, covered lines) in the spec table. Point your CI dashboard, coverage gate, or report converter at the file and assert those counts survive; format twins carry identical numbers so a conversion can be scored exactly.

Code examples

import json

with open("performance-budget.json") as f:
    data = json.load(f)
print(type(data), len(data))

Generated by generation/testing.py. Free for any use, no attribution required — license.