@ogygia/devtools 0.11.4 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/app.d.ts +3 -0
- package/dist/app.js +9 -0
- package/dist/devtools/BoundaryOverlay.svelte +10 -6
- package/dist/devtools/Devtools.svelte +24 -18
- package/dist/devtools/IslandDetail.svelte +7 -5
- package/dist/devtools/PageTab.svelte +4 -2
- package/dist/devtools/ProfilerTab.svelte +8 -2
- package/dist/devtools/SessionTab.svelte +21 -8
- package/dist/devtools/highlight.js +14 -7
- package/dist/devtools/ledger-dom.js +6 -9
- package/dist/devtools/names.js +18 -17
- package/dist/devtools/page.d.ts +2 -0
- package/dist/devtools/page.js +37 -17
- package/dist/devtools/profile-store.d.ts +4 -9
- package/dist/devtools/profile-store.js +26 -21
- package/dist/devtools/session.d.ts +2 -0
- package/dist/devtools/session.js +48 -42
- package/dist/devtools/testing-engine.js +10 -1
- package/dist/devtools/ui-app.d.ts +3 -1
- package/dist/devtools/ui-app.js +9 -3
- package/dist/devtools/ui.js +83 -40
- package/dist/messages/build.d.ts +21 -0
- package/dist/messages/build.js +56 -0
- package/dist/messages/index.d.ts +3 -0
- package/dist/messages/index.js +3 -0
- package/dist/messages/runtime.d.ts +63 -0
- package/dist/messages/runtime.js +122 -0
- package/dist/profiler/async-io.d.ts +12 -7
- package/dist/profiler/async-io.js +94 -82
- package/dist/profiler/beacon-standalone.js +15 -6
- package/dist/profiler/busy.d.ts +13 -0
- package/dist/profiler/busy.js +45 -0
- package/dist/profiler/client.js +5 -24
- package/dist/profiler/embedded-maps.js +9 -5
- package/dist/profiler/gc.d.ts +5 -0
- package/dist/profiler/gc.js +75 -11
- package/dist/profiler/index.d.ts +23 -2
- package/dist/profiler/index.js +648 -373
- package/dist/profiler/net.d.ts +14 -6
- package/dist/profiler/net.js +61 -45
- package/dist/profiler/patterns.js +29 -1
- package/dist/profiler/source-scan.js +24 -12
- package/dist/profiler/standalone.js +12 -4
- package/dist/profiler/storage/index.d.ts +14 -3
- package/dist/profiler/storage/index.js +41 -41
- package/dist/profiler/storage/postgres.d.ts +18 -5
- package/dist/profiler/storage/postgres.js +124 -85
- package/dist/profiler/storage/redis.d.ts +18 -5
- package/dist/profiler/storage/redis.js +160 -131
- package/dist/profiler/storage/sqlite.d.ts +15 -2
- package/dist/profiler/storage/sqlite.js +54 -48
- package/dist/profiler/ui/ComponentsTable.svelte +2 -2
- package/dist/profiler/ui/Dashboard.svelte +2 -3
- package/dist/profiler/ui/DownloadHtml.svelte +1 -0
- package/dist/profiler/ui/ExportButton.svelte +1 -0
- package/dist/profiler/ui/Flame.svelte +10 -4
- package/dist/profiler/ui/Flame.svelte.d.ts +0 -5
- package/dist/profiler/ui/FrameDetails.svelte +13 -2
- package/dist/profiler/ui/FrameDetails.svelte.d.ts +0 -6
- package/dist/profiler/ui/FunctionsTable.svelte +2 -2
- package/dist/profiler/ui/IslandsTable.svelte +2 -2
- package/dist/profiler/ui/OnThisPage.svelte +12 -4
- package/dist/profiler/ui/RunView.svelte +31 -27
- package/dist/profiler/ui/ShareLink.svelte +6 -1
- package/dist/profiler/ui/Sidebar.svelte +14 -9
- package/dist/profiler/ui/Treemap.svelte +11 -4
- package/dist/profiler/ui/Treemap.svelte.d.ts +0 -6
- package/dist/profiler/ui/WaitingTable.svelte +2 -2
- package/dist/profiler/ui/fake-progress.svelte.d.ts +7 -12
- package/dist/profiler/ui/fake-progress.svelte.js +57 -36
- package/dist/profiler/ui/press.js +4 -2
- package/dist/profiler/ui/row-anchor.svelte.d.ts +0 -6
- package/dist/profiler/ui/row-anchor.svelte.js +13 -8
- package/dist/profiler/ui/sort.svelte.d.ts +9 -6
- package/dist/profiler/ui/sort.svelte.js +34 -28
- package/dist/profiler/visit.d.ts +0 -1
- package/dist/profiler/visit.js +1 -2
- package/dist/server.js +27 -10
- package/dist/vite.js +3 -2
- package/package.json +18 -9
package/dist/profiler/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { Forecast } from "./forecast.js";
|
|
|
18
18
|
import { HeapGrowth, Pattern } from "./patterns.js";
|
|
19
19
|
import { SpanRecord } from "./span.js";
|
|
20
20
|
import { PageAssets } from "@ogygia/core/insights";
|
|
21
|
+
import { Flights } from "@ogygia/machine";
|
|
21
22
|
import { Handle } from "@ogygia/core/plugin";
|
|
22
23
|
export interface ProfilerOptions {
|
|
23
24
|
/**
|
|
@@ -114,7 +115,7 @@ export interface ProfilerOptions {
|
|
|
114
115
|
* own copies). Not a `devtools({ profiler })` option: a store is a live object the build-time
|
|
115
116
|
* options cannot carry, so the app sets it at runtime with `setProfilerStore(store)` from
|
|
116
117
|
* `@ogygia/devtools/profiler/storage`, in hooks.server.ts, and the server half passes it in here
|
|
117
|
-
* when the profiler mounts. A store is `
|
|
118
|
+
* when the profiler mounts. A store is `new SqliteStore(…)`, `new RedisStore(…)` or `new PostgresStore(…)`
|
|
118
119
|
* from `@ogygia/devtools/profiler/storage/{sqlite,redis,postgres}`, or your own; every finished
|
|
119
120
|
* report is written there and read back from there, so it survives the instance that made it and
|
|
120
121
|
* a whole team shares one list. The store is dual-written: memory stays the hot cache, the store
|
|
@@ -147,7 +148,9 @@ export interface TrapStatus {
|
|
|
147
148
|
window_ms: number;
|
|
148
149
|
caught: number;
|
|
149
150
|
keep: number;
|
|
150
|
-
armed
|
|
151
|
+
/** `armed`: it waits for or takes its next window; `stopped`: a window failed (the dashboard's
|
|
152
|
+
* note says why); `done`: it kept all it was asked to, or is not armed yet */
|
|
153
|
+
state: "armed" | "done" | "stopped";
|
|
151
154
|
}
|
|
152
155
|
interface UserTiming {
|
|
153
156
|
name: string;
|
|
@@ -262,6 +265,24 @@ export interface StoredReport {
|
|
|
262
265
|
* stacks); `null` for anything not shaped like a trace. Exported for the tests.
|
|
263
266
|
*/
|
|
264
267
|
export declare function self_profile_to_cpuprofile(trace: unknown): CpuProfile | null;
|
|
268
|
+
/** A report's fetch of one of the app's files, through the app (`signal`: the weigh gave up). */
|
|
269
|
+
type FetchUrl = (url: string, signal?: AbortSignal) => Promise<Response>;
|
|
270
|
+
/** What one weigh is handed: the URL (its key), and the fetch of the report that asked. */
|
|
271
|
+
type WeighAsk = {
|
|
272
|
+
url: string;
|
|
273
|
+
fetch_url: FetchUrl;
|
|
274
|
+
};
|
|
275
|
+
/** Bytes per asset URL (`null`: the file is not there), measured once per process: a hashed
|
|
276
|
+
* asset never changes. */
|
|
277
|
+
type UrlWeights = Flights<WeighAsk, number | null, Pick<WeighAsk, "url">>;
|
|
278
|
+
/** The process's URL weights: an answer (bytes, or a file that is not there) is kept; a failure
|
|
279
|
+
* (a 5xx, a timeout, the network) is not, so the next report asks again. Reports weighing the
|
|
280
|
+
* same file at once share one fetch. */
|
|
281
|
+
export declare const url_weights: () => UrlWeights;
|
|
282
|
+
/** GET each URL through the app's own fetch and count its bytes — the JS weight of an island's
|
|
283
|
+
* closure. Kept per process (`url_weights`), a handful at a time, capped in time so a slow static
|
|
284
|
+
* host can never hold a report hostage: a URL not weighed within the budget is left out. */
|
|
285
|
+
export declare function weigh_urls(urls: Iterable<string>, fetch_url: FetchUrl, weights: UrlWeights, budget_ms?: number): Promise<Record<string, number>>;
|
|
265
286
|
/**
|
|
266
287
|
* Build a profiler handle. INTERNAL — the profiler is configured in vite.config.ts
|
|
267
288
|
* (`ogygia({ profiler: true })`) and `ogygia.handle()` constructs + mounts this itself.
|