Optionalconfig: Partial<MonitorConfig>PrivatecontainerPrivatepanelPrivateloadersPrivateeventsPrivatemetricsPrivatequeriesPrivateadvisorPrivateconfigPrivateuiPrivatepollingPrivateeventPrivatelastPrivateeventPrivatemaxPrivatecachedPrivateratesPrivateuiHandle UI events through event delegation
Private ReadonlyprovidersPrivate ReadonlycachePrivate ReadonlyscenePrivateretryIn-flight guard so the banner's Retry button can't stack batches.
PrivatelastLast-rendered failed-loads state; a change marks the overview structure dirty.
PrivatecontentPrivatecollapsedPrivateanimatePrivatestructurePrivateeventDisconnect a loader
Disconnect all loaders and reset monitor state This should be called when loading a new scene
Set the failed-loads provider for the Overview tab's retry banner
(count/paths + retry-all; see FailedLoadsProviderPort).
Set the cache stats provider for L1/L2 cache monitoring. This enables the monitor to display actual cache statistics.
Push the cache telemetry state resolved by cache-setup.ts.
Called once per scene load so the UI shows the right
disabled-reason (?noCache URL flag vs app-config disable vs
pre-wiring transition). Without this, the aggregator falls back
to provider-presence inference and misrepresents ?noCache runs
as not-wired.
Set the L0 decompressed chunk cache provider for L0 cache monitoring. This enables the monitor to display L0 cache statistics in the Cache tab.
Register the SliceCache ("S-cache") stats/clear provider so the Cache tab shows its usage and hit rate. Mirrors setL0CacheProvider.
Set the GPU buffer pool provider for Memory tab stats. The provider should have a getStats() method that returns PoolStats.
Set the update profiler for Performance tab timing display. The profiler tracks hierarchical timing of scene updates.
Set the LOD-progress provider for live LOD / refinement / residency state in the scene-graph tree. Polled each tick. Passing a provider marks the structure dirty so the tree re-renders with chip slots.
Set the draw-order provider for live per-mesh compositing state (blending bucket / depthWrite / renderOrder) in the scene-graph tree. Polled each tick. Passing a provider marks the structure dirty so the tree re-renders with the draw-order chip slot.
Live density-guard state per node (the tree's lattice-glyph 1/K density chip). App-scoped:
wired once by the init pipeline and kept across scene switches.
Set an accumulator provider for Memory tab stats.
Which accumulator, one of POOLED_GEOMETRY_TYPES
The accumulator with a getStats() method
Null every closure-bound provider tied to the active scene's loader (cache stats, L0 cache, GPU buffer pool, accumulators, profiler).
Required when a scene reload disposes the previous SceneLoader: each
provider was a closure that captured the now-disposed loader's
fields (this.l0Cache, etc.). Calling them after dispose throws —
e.g. the L0 closure () => this.l0Cache!.getStats() NPEs once the
previous loader nulled its l0Cache. Under ?noCache the next
scene never installs replacements either, so without this reset the
stale closures live until tab close.
PrivateresetReset scene graph display state.
Called from disconnectAllLoaders() (scene reload) and dispose()
(full teardown). Without this, a reload that fails before
setSceneGraph() runs leaves the monitor showing the previous
scene's tree, while loaders/providers have already been cleared —
a "ghost tree" mismatch in the Scene Graph panel.
Also resets expandedNodes so a new scene starts from a freshly
collapsed tree (the root '/' marker preserves the previous default).
Clear L0 decompressed chunk cache.
Clear the SliceCache ("S-cache").
Clear L1 memory cache.
Clear L2 OPFS cache. Asks for confirmation first since the L2
persistent cache requires a network re-fetch to repopulate. The
confirm dialog can be skipped by passing { skipConfirm: true }
— used by tests and by the debug API where the caller has already
confirmed intent.
Optionalopts: { skipConfirm?: boolean }Clear all caches (L0 + L1 + L2). Confirmation dialog can be
skipped via { skipConfirm: true }.
Optionalopts: { skipConfirm?: boolean }Set the scene graph for display in the monitor. Called by SceneLoader after loading scene.
Get current scene graph state.
Toggle expansion state of a node in the scene graph tree.
Check if a node is expanded in the tree view.
Update the count of currently visible elements of one geometry type.
Called by SceneLoader (via updateVisibleCountsInMonitor) after the
per-type commits, so the HUD reports post-nD-clipping and
post-progressive-refinement counts rather than raw loaded ones. One
kind-keyed setter rather than one method per type: the three bodies were
identical apart from the field each wrote.
Per-node visible counts after nD slicing, keyed by scene-graph path.
Pushed by the SceneLoader's visible-counts walk (only rendered meshes
contribute). Merged into the tree nodes so badge tooltips can show
"(N visible after slicing)" per layer; the merge happens in
SceneGraphModel.syncVisibleCountsIntoTree(), run on the poll tick
immediately before the incremental badge patch. Nodes whose path is
absent from the latest map (the walk prunes non-visible subtrees) have
their count cleared so tooltips never show a stale number.
PrivateonPolling tick handler - called periodically by the polling loop. This is the main update entry point that:
PrivateprocessProcess a single event (called from polling tick, not from loaders). This is now decoupled from event emission - events are batched and processed during the polling tick.
PrivateupdatePrivatetrackPrivatecreateForce an immediate UI update. Used when scene changes or loaders are connected. Triggers an immediate polling tick to process any queued events and refresh the UI.
PrivateupdateUpdate UI
PrivatehandleHandle UI events through event delegation
PrivatereportPrivatetoggleToggle a Cache-tab section between its full metric-card view and the compact one-line header summary. Both views are always in the DOM (visibility is CSS-driven), so the toggle is a pure class flip — no re-render, and the per-tick patcher keeps updating both.
PrivatecreateCreate UI elements
PrivateupdateUpdate panel CSS classes based on current state
PrivatebuildBuild the compact-view element summary. Shows one count per geometry
type actually present in the scene, from the same shared headline table
the Overview tab's hero cards use (headline-counts.ts) — so the badge
can't disagree with the expanded panel about which types exist, and a
lines-, gsplats- or mesh-only dataset no longer mislabels its elements
as "points". Falls back to a points entry when nothing has loaded yet.
PrivateupdateTry to update just the compact view values without replacing innerHTML. This preserves event handlers and prevents interaction loss during polling updates.
true if incremental update succeeded, false if full rebuild is needed
PrivateupdateUpdate compact view. Tries incremental value update first; only does full innerHTML rebuild when the structure doesn't exist yet (first render or after expand/minimize).
PrivatebuildBuild the detailed view structure once (called on expand or tab change)
PrivateattachAttach handlers needed by the current tab after a full content rebuild.
PrivateupdateUpdate detailed view using targeted DOM patching.
On each polling tick, tries incremental value updates first (updating only textContent/style of specific elements via data-field attributes). This preserves the DOM tree, event handlers, focus, and scroll position.
Falls back to full innerHTML rebuild only when:
PrivateupdateIncrementally update overview tab values without rebuilding DOM. Updates primary metric cards, secondary metrics, and scene graph badges.
PrivateupdateIncrementally update cache tab values without rebuilding DOM.
Delegates to tabs/cache-tab.ts:updateCacheTab.
PrivateupdateIncrementally update memory tab values without rebuilding DOM.
PrivaterenderRender tabs
PrivaterenderRender tab content
PrivateretryRetry every failed loader via the injected provider (the monitor-side
trigger for SceneLoader.retryAllFailedLoaders; the loader serializes
the batch against its update lock). Guards against double-clicks while
a batch is in flight and refreshes the banner on completion.
PrivaterenderRender overview tab with cleaner visual hierarchy
PrivaterenderRender comprehensive cache analytics tab
PrivaterenderRender memory tab with GPU buffer pool and accumulator stats
PrivategetGet memory metrics from providers
PrivaterenderRender performance tab with hierarchical timing panel
PrivaterenderRender insights tab
Get global statistics
PrivategetGet cache metrics aggregated across all loaders. Delegates the
multi-source roll-up to
data-loading-monitor/metrics/cache.ts:aggregateCacheMetrics.
The aggregator refreshes this.metrics snapshots and reads
this.cachedRates (already updated by calculateRates() here).
PrivatecleanClean old events based on age
PrivatecalculateCalculate all rates with caching. Delegates to
data-loading-monitor/metrics/rates.ts:calculateRates.
PrivaterenderCycle through monitor states: hidden → mini → expanded → hidden This implements the three-state cycling as per the comprehensive plan
PrivatestartStart the polling loop for periodic updates. Called when the monitor becomes visible.
PrivatestopStop the polling loop. Called when the monitor is hidden.
Main Data Loading Monitor class