QueueStats
Statistics snapshot from an AudioBufferQueue instance.
Defined in: src/core/pipeline/AudioBufferQueue.ts:87
Statistics snapshot from an AudioBufferQueue instance.
Remarks
Returned by AudioBufferQueue.getStats for pipeline health monitoring. All counters are cumulative since the queue was created (or since the last AudioBufferQueue.clear call reset the buffer).
Example
const stats = queue.getStats();
console.log(`Queue "${stats.name}": ${stats.size} chunks buffered, ${stats.totalDropped} dropped`);
if (stats.oldestChunkAge > 5000) {
console.warn('Queue is backing up — oldest chunk is over 5 seconds old');
}
See
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
name | string | Diagnostic name of the queue. Remarks Matches the AudioBufferQueueConfig.name used to construct the queue. | src/core/pipeline/AudioBufferQueue.ts:94 |
oldestChunkAge | number | Age of the oldest chunk in the buffer, in milliseconds. Remarks Calculated as Date.now() - oldestChunk.timestamp. Returns 0 when the buffer is empty or the queue is in draining mode. | src/core/pipeline/AudioBufferQueue.ts:138 |
size | number | Current number of chunks in the buffer. Remarks Always 0 when the queue is in draining mode (pass-through). | src/core/pipeline/AudioBufferQueue.ts:102 |
totalDequeued | number | Total number of chunks delivered to the drain callback. Remarks Includes both buffered chunks flushed during AudioBufferQueue.startDraining and chunks that passed through directly in draining mode. | src/core/pipeline/AudioBufferQueue.ts:120 |
totalDropped | number | Total number of chunks dropped due to overflow. Remarks Only non-zero when the overflow strategy is 'drop-oldest' or 'drop-newest' and the queue reached its maxSize. | src/core/pipeline/AudioBufferQueue.ts:129 |
totalEnqueued | number | Total number of chunks enqueued since creation. Remarks Includes chunks that were subsequently dropped due to overflow, as well as chunks that passed through directly in draining mode. | src/core/pipeline/AudioBufferQueue.ts:111 |