MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getBufferSize

Method getBufferSize

packages/db/src/buffers/base-buffer.ts:275–277  ·  view source on GitHub ↗

* Ground-truth size of the buffer (LLEN of the Redis list). O(1). The * previous implementation kept a shadow counter to "avoid" LLEN — but * LLEN and GET are both O(1) single-roundtrip ops in Redis, so the * counter was free complexity that silently drifted (see incident * 2026-05-20).

()

Source from the content-addressed store, hash-verified

273 * 2026-05-20). Always use this.
274 */
275 async getBufferSize(): Promise<number> {
276 return await getRedisCache().llen(this.getRedisListKey());
277 }
278
279 /**
280 * Time the body of an `add()` call. Subclasses wrap their work with this

Callers 6

tryFlushMethod · 0.95
persistMethod · 0.80
collectFunction · 0.80

Calls 2

getRedisListKeyMethod · 0.95
getRedisCacheFunction · 0.90

Tested by

no test coverage detected