| 58 | } |
| 59 | |
| 60 | function assertDebugStatsShape(stats) { |
| 61 | assert(stats && typeof stats === "object", "engineDebugGetStats must return an object"); |
| 62 | assert(typeof stats.totalRecords === "bigint", "debug stats totalRecords must be bigint"); |
| 63 | assert(typeof stats.totalDropped === "bigint", "debug stats totalDropped must be bigint"); |
| 64 | assert(typeof stats.errorCount === "number", "debug stats errorCount must be number"); |
| 65 | assert(typeof stats.warnCount === "number", "debug stats warnCount must be number"); |
| 66 | assert(typeof stats.currentRingUsage === "number", "debug stats currentRingUsage must be number"); |
| 67 | assert(typeof stats.ringCapacity === "number", "debug stats ringCapacity must be number"); |
| 68 | } |
| 69 | |
| 70 | function readU64LE(bytes, offset) { |
| 71 | const dv = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength); |