Skip to content

Stats ​

Statistics available through idetik.stats.

Getters read the current state. Only chunks walks chunk states. Reading runtime rates, memory usage, queue counts, or rendered objects does not scan chunks.

Types ​

MemoryStats ​

A snapshot of memory used by chunks, renderer textures, and the JS heap.

PropertyDescription
cpuChunkBytes: numberBytes of chunk data in CPU memory, shared across all Idetik instances.
cpuChunkCount: numberNumber of chunks in CPU memory, shared across all Idetik instances.
gpuTextureBytes: numberBytes of texture data resident on this instance's GPU renderer.
gpuTextureCount: numberNumber of textures resident on this instance's GPU renderer.
jsHeapUsedBytes?: numberUsed JS heap in bytes, when the browser exposes it. Not instance-specific.
jsHeapLimitBytes?: numberJS heap size limit in bytes, when the browser exposes it.

RuntimeStats ​

A snapshot of drawing frequency and GPU draw cost.

Values are averaged over sampling windows of at least one second. A frame is one canvas draw pass across all viewports including draws during resize. GPU timings are collected asynchronously and lag draw submission.

PropertyDescription
gpuTimingSupported: booleanWhether GPU timer queries are supported by the current renderer context.
renderedFramesPerSecond: numberCanvas draw passes per second in the latest sampling window. This value diverges from frames per second when on-demand rendering is enabled.
gpuMsPerFrame?: numberMean elapsed GPU timeline time per sampled canvas render pass, in ms. The interval spans drawing across all viewports, excluding layer updates. Undefined when no recent valid sample exists.

QueueStats ​

A snapshot of the chunk request queue.

PropertyDescription
pending: numberNumber of requests waiting to start.
running: numberNumber of requests currently in flight.

ChunkStats ​

A snapshot of chunk demand and GPU residency.

Requested counts include prefetch. When the memory limit cannot hold every requested chunk, some are never fetched and resident stays below requested.

PropertyDescription
sources: readonly SourceChunkStats[]Cache state per source.
viewports: readonly ViewportChunkStats[]Loading progress per viewport. Viewports without chunked layers are omitted.

SourceChunkStats ​

Cache state for one source, combined across all of its views.

PropertyDescription
source: ChunkSourceThe source the counts describe.
requested: numberChunks requested by any view, visible or prefetch, at any LOD. A chunk requested by several views counts once. The budget may defer fetching.
resident: numberHow many of requested are on the GPU and drawable.
timepoints: objectThe same counts by timepoint index, the position along the source's time axis rather than the world t coordinate. A timepoint is fully loaded for every view of the source when its two counts are equal.
timepoints.requested: Uint32Arrayrequested[t] is the chunks requested at timepoint index t.
timepoints.resident: Uint32Arrayresident[t] is how many of requested[t] are on the GPU.

ViewportChunkStats ​

Loading progress for one viewport, summed across its chunked layers.

PropertyDescription
viewportId: stringThe viewport the counts describe.
requested: numberVisible and prefetch chunks at any LOD, including the fallback LOD drawn while the current one loads.
resident: numberHow many of requested are on the GPU.
current: objectThe same counts excluding fallback and prefetch: chunks visible at each layer's current LOD and timepoint. The viewport is fully drawn at its selected LOD when these are equal.
current.requested: numberChunks visible at each layer's current LOD and timepoint.
current.resident: numberHow many of requested are on the GPU.

Accessors ​

runtime RuntimeStats ​

Drawing frequency and GPU cost, recalculated on read when at least one second has passed since the last calculation or reset. Values cover that entire interval, so less frequent reads produce longer-term averages.

ts
get runtime(): RuntimeStats;

memory MemoryStats ​

CPU chunk memory shared across instances, this renderer's GPU texture memory, and optional JS heap figures. Heap figures are not specific to this instance. Sizes are in bytes.

ts
get memory(): MemoryStats;

queue QueueStats ​

Counts of queued and in-flight chunk requests for this instance.

ts
get queue(): QueueStats;

chunks ChunkStats ​

Chunk demand and GPU residency per source, by timepoint, and loading progress per viewport. Each read walks every view's chunk states, so poll it at the rate you need rather than every frame.

ts
get chunks(): ChunkStats;

renderedObjects number ​

Objects reported by the renderer for the last viewport render.

ts
get renderedObjects(): number;

Released under the MIT License