@ogygia/devtools · API
@ogygia/devtools/report
Reading a saved profiler report in Node. Open an exported .ogp, check a dump, build its JSON report, and add up what its fixes are worth.
On this page
This page is generated from the package’s own .d.ts files on every build, so the signatures, descriptions and examples below always match the source.
Exports fix_impact · is_dump · is_ogp · ogp_decode · report_json · Forecast
import { … } from '@ogygia/devtools/report';fix_impact
function
"Fix these and the render goes from 754 ms to ~300 ms." Each costly line belongs to one pattern, so the savings add without counting a line twice; the sum is capped at 90 % of the render (an estimate never promises a free page). Undefined without a render to measure against.
UNITS: a CPU pattern's numbers add up the whole recording — renders renders in page mode —
while a waiting pattern is measured on ONE render (the network log is scoped to one run). CPU
savings are divided by renders so both are per render, like render_ms.
function fix_impact(patterns: readonly Pick<Pattern, "save_ms" | "wait">[], render_ms: number, renders?: number, wait_ms?: number): FixImpact | undefined;function is_dump(x: unknown): x is {
meta: ReportMeta;
analysis: Analysis;
extras: ReportExtras;
};is_ogp
function
True when bytes starts with the .ogp magic (so import can tell it from legacy plain JSON).
function is_ogp(bytes: Uint8Array): boolean;ogp_decode
function
Decrypt + decompress .ogp bytes back to the dump object. Throws on a wrong key or a tampered file
(the GCM tag fails to verify) — the caller turns that into a "wrong key" message. Unpacking stops
at max bytes: past it, devtools_profiler_upload_too_large.
function ogp_decode(bytes: Uint8Array, secret: string | undefined, max?: number): Promise<unknown>;function report_json(a: Analysis, meta: ReportMeta, base: string, extras: ReportExtras): ReportJson;Forecast
interface
Forecast.now_ms
one render now: the median of the profiled renders, ms, as the app paid it
Forecast.after_ms
one render with every fix below, ms (an estimate)
Forecast.caps
what the render used, which capped the savings: its waiting and its CPU, ms (the compare's fix check counts a later report's fixes the same way)
Forecast.cpu_ms
the parts of the saving: CPU, waiting, and work deleted, ms per render
Forecast.wait_ms
Forecast.delete_ms
Forecast.cpu_now_ms
the main thread's CPU a render, now and after every fix (ms): what bounds how many renders a core serves — the waiting fixes cut the time a visitor waits, only the CPU ones raise that
Forecast.cpu_after_ms
Forecast.parts
the fixes counted, biggest first; with: the other fixes on the same lines, whose saving
this one already covers; after_ms: one render once this fix AND every one above it is done
Forecast.answers
caching the services' answers on top (same answer every render): one render after that, and
those fixes. A decision about how stale an answer may be, so left out of after_ms
Forecast.cache
the whole document is cacheable: a cached copy costs the render nothing — a different lever,
left out of after_ms
Forecast.clamped
the savings claimed more waiting or CPU than the render had (they overlap in ways the lines do not show): each was held at what the render used
Forecast.partial
the build had no sourcemaps: the profiler saw fewer lines, so fewer fixes — the real time after them is likely lower
interface Forecast {/*…*/}now_ms: number;after_ms: number;caps?: {
wait?: number;
cpu?: number;
};cpu_ms: number;wait_ms: number;delete_ms: number;cpu_now_ms?: number;cpu_after_ms?: number;parts: {
title: string;
kind: string;
ms: number;
wait: boolean;
after_ms?: number;
with?: string[];
}[];answers?: {
after_ms: number;
wait_ms: number;
parts: Forecast["parts"];
clamped?: boolean;
measured?: {
ms: number;
renders: number;
model_ms: number;
};
};cache?: boolean;clamped?: boolean;partial?: boolean;