Skip to content
Novus Examples
json2.2 KB

Speedscope — Sampled Profile with a Shared Frame Table (json)

A speedscope sampled profile: one shared frame table with source locations, then stacks expressed as arrays of frame indices with per-sample weights in nanoseconds. The index indirection is the whole design, and resolving it wrong produces a plausible but wrong flamegraph.

Preview — first 50 linesjson
{
  "$schema": "https://www.speedscope.app/file-format-schema.json",
  "name": "checkout-api cpu profile",
  "exporter": "novus-examples observability fixture",
  "activeProfileIndex": 0,
  "shared": {
    "frames": [
      {
        "name": "(root)",
        "file": "/src/checkout/main.go",
        "line": 10
      },
      {
        "name": "main",
        "file": "/src/checkout/main.go",
        "line": 27
      },
      {
        "name": "http.(*conn).serve",
        "file": "/src/checkout/main.go",
        "line": 44
      },
      {
        "name": "checkout.Handle",
        "file": "/src/checkout/main.go",
        "line": 61
      },
      {
        "name": "checkout.price",
        "file": "/src/checkout/main.go",
        "line": 78
      },
      {
        "name": "pricing.applyDiscount",
        "file": "/src/checkout/main.go",
        "line": 95
      },
      {
        "name": "encoding/json.Marshal",
        "file": "/usr/local/go/src/runtime/mgc.go",
        "line": 112
      },
      {
        "name": "sql.(*DB).QueryContext",
        "file": "/usr/local/go/src/runtime/mgc.go",
        "line": 129
      },
      {
        "name": "runtime.gcBgMarkWorker",
        "file": "/usr/local/go/src/runtime/mgc.go",
125 lines total — download for the full file.

Specifications

Profile Type
sampled
Frames
9
Samples
7
Unit
nanoseconds
Duration Seconds
30
Weights Sum Ns
16830000000
Frames Deduplicated
true

Testing contract

Expected to pass
Scenario
Load the profile and resolve each sample's frame indices to names.
Expected result
Seven samples resolve through the nine-entry frame table with no index out of range, and the weights total 16.83 seconds inside a 30-second window.

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

“Speedscope — Sampled Profile with a Shared Frame Table (json)” is a deterministic Novus Examples fixture for Observability, JSON parsing, Performance testing. Structured and plain-text telemetry with known timestamps, levels, request identifiers, and error states for testing log ingestion, correlation, dashboards, and alert pipelines.

Documented properties for this file: JSON · 2,231 bytes. 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.

Telemetry fixtures use fixed trace IDs, span IDs, and timestamps so ingestion is reproducible run to run. Point your collector, parser, or query layer at the file and assert the documented span tree, metric families, or severity mix; service and host names are invented.

Code examples

import json

with open("speedscope-sampled-profile.json") as f:
    data = json.load(f)
print(type(data), len(data))

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