MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / parseQueryResult

Function parseQueryResult

packages/core/src/debug/parsers.ts:397–425  ·  view source on GitHub ↗
(bytes: Uint8Array)

Source from the content-addressed store, hash-verified

395 * - _pad0: u32 (bytes 28-31)
396 */
397export function parseQueryResult(bytes: Uint8Array): DebugParseResult<DebugQueryResult> {
398 if (bytes.byteLength < DEBUG_QUERY_RESULT_SIZE) {
399 return fail(
400 "ZR_TRUNCATED",
401 0,
402 `need ${DEBUG_QUERY_RESULT_SIZE} bytes for query result but only ${bytes.byteLength} available`,
403 );
404 }
405
406 const r = new BinaryReader(bytes);
407
408 const recordsReturned = r.readU32();
409 const recordsAvailable = r.readU32();
410 const oldestRecordId = readU64(r);
411 const newestRecordId = readU64(r);
412 const recordsDropped = r.readU32();
413 // Skip _pad0
414
415 return {
416 ok: true,
417 value: {
418 recordsReturned,
419 recordsAvailable,
420 oldestRecordId,
421 newestRecordId,
422 recordsDropped,
423 },
424 };
425}
426
427/**
428 * Parse debug statistics.

Callers 1

parsers.test.tsFile · 0.85

Calls 3

readU32Method · 0.95
readU64Function · 0.85
failFunction · 0.70

Tested by

no test coverage detected