Skip to content

Low-Level API Stats

AkkEngine::stats() returns an akkaradb::engine::EngineStats snapshot. The values are counters and point-in-time subsystem state; they are intended for debugging, operational dashboards, benchmarks, and sanity checks in integration tests.

const auto stats = db->stats();
const double readHitRate =
stats.getsTotal == 0
? 0.0
: double(stats.getsMemtableHit + stats.getsSstHit) / double(stats.getsTotal);
FieldMeaning
currentSeqLatest engine sequence number assigned to writes.
nodeIdStable node id used by local or clustered operation.
putsTotalTotal successful top-level put calls.
removesTotalTotal top-level remove calls.
getsTotalTotal top-level get calls.
getsMemtableHitReads served from MemTable.
getsSstHitReads served from SST.
getsMissReads that did not find an active value.
existsTotalExistence checks.
scansTotalRange scan calls.
blobPutsTotalWrites routed through Blob storage.

The top-level read counters let you estimate whether the working set is mostly in memory, mostly in SST, or missing. Compare getsMemtableHit, getsSstHit, and getsMiss against getsTotal.

FieldMeaning
memtable.shardCountActive MemTable shard count.
memtable.thresholdBytesPerShardFlush threshold configured per shard.
memtable.approxBytesApproximate bytes currently held in MemTable.
memtable.putsAppliedPuts applied to MemTable internals.
memtable.removesAppliedTombstones applied to MemTable internals.
memtable.flushesCompletedCompleted MemTable flushes.
memtable.bytesFlushedBytes emitted through flushes.

approxBytes rising toward thresholdBytesPerShard * shardCount indicates flush pressure. A high flush count with low bytes per flush can mean thresholds are too small for the workload.

FieldMeaning
wal.enabledWhether WAL is active.
wal.shardCountActive WAL shard count.
wal.entriesWrittenWAL entries written.
wal.bytesWrittenWAL bytes written.
wal.batchesFlushedGrouped WAL batches flushed.
wal.syncsExecutedPhysical sync calls executed.
wal.segmentRotationsWAL segment rotations.

For SYNC durability, syncsExecuted should track writes more closely. For ASYNC, grouped flushes should reduce sync frequency while increasing batch size.

FieldMeaning
sst.enabledWhether SST storage is active.
sst.levelsPer-level file count, bytes, and budget.
sst.fileCountTotal SST file count.
sst.bytesTotal SST bytes.
sst.l0FileCountNumber of files in level 0.
sst.compactionPendingWhether compaction work is pending.
sst.compactionsCompletedCompleted compactions.
sst.filesCompactedFiles consumed by compaction.
sst.bytesCompactedInBytes read by compaction.
sst.bytesCompactedOutBytes written by compaction.
sst.l0StallsL0-related stall events.

Watch l0FileCount, compactionPending, and l0Stalls together. If they climb under sustained writes, the compaction side is not keeping up with flush production.

Each sst.levels entry has:

FieldMeaning
levelLSM level number.
fileCountFiles in that level.
bytesBytes stored in that level.
budgetBytesTarget byte budget for the level.
FieldMeaning
blob.enabledWhether Blob storage is active.
blob.thresholdBytesValue-size threshold for Blob offload.
blob.blobsWrittenBlob files written.
blob.bytesUncompressedOriginal payload bytes.
blob.bytesOnDiskBytes stored on disk.
blob.blobsDeletedBlob files deleted.
blob.gcCyclesBlob garbage-collection cycles.

Compare bytesUncompressed and bytesOnDisk when compression is enabled. gcCycles increasing without blobsDeleted usually means GC is running but not finding reclaimable files.

FieldMeaning
vlog.enabledWhether version history is active.
vlog.syncModeNumeric value of the version-log sync mode.
vlog.groupNGrouping threshold by entry count.
vlog.groupMicrosGrouping threshold by time.
vlog.groupBytesGrouping threshold by bytes.
vlog.asyncMaxPendingBytesPending async write budget.
vlog.indexedKeysKeys with indexed history.
vlog.indexedEntriesTotal indexed history entries.
vlog.rollbackEntriesEntries produced by rollback operations.
vlog.pendingWritesVersion-log writes not yet flushed.
vlog.pendingBytesPending version-log bytes.
vlog.durableBytesBytes durable in the version log.
vlog.flushThreadRunningWhether the async flush thread is running.

Use pendingBytes and asyncMaxPendingBytes to detect backpressure risk. rollbackEntries should be nonzero only when rollback APIs are used.

stats.api is populated when the API server component is enabled.

GroupFields
HTTP statehttpEnabled, httpTlsEnabled, httpPort, httpMaxBatchItems, httpMaxScanItems, httpMaxHistoryEntries, httpMaxContentLength
HTTP traffichttpConnectionsAcceptedTotal, httpConnectionsClosedTotal, httpConnectionsActive, httpRequestsTotal, httpResponsesTotal, httpBytesReceivedTotal, httpBytesSentTotal
HTTP errorshttpProtocolErrorsTotal, httpErrorsTotal
HTTP batcheshttpBatchPutItemsTotal, httpBatchGetItemsTotal
TCP statetcpEnabled, tcpTlsEnabled, tcpIoBackend, tcpWorkerThreads, tcpAcceptQueueLimit, tcpListenBacklog, tcpReadTimeoutMs, tcpWriteTimeoutMs
TCP traffictcpConnectionsAcceptedTotal, tcpConnectionsClosedTotal, tcpConnectionsActive, tcpRequestsTotal, tcpResponsesTotal, tcpBytesReceivedTotal, tcpBytesSentTotal
TCP queue/backpressuretcpAcceptQueueDepth, tcpAcceptQueuePeakDepth, tcpAcceptQueueRejectedTotal, tcpAcceptQueueExpiredTotal, tcpBackpressureFlushesTotal, tcpBackpressureDisconnectsTotal
TCP errors/batchestcpProtocolErrorsTotal, tcpCrcErrorsTotal, tcpPipelineBatchesTotal, tcpBatchPutItemsTotal, tcpBatchGetItemsTotal
gRPC stategrpcEnabled, grpcTlsEnabled, grpcPort, grpcWorkerThreads, grpcCompletionQueues, grpcMinPollers, grpcMaxPollers, grpcMaxConcurrentStreams, grpcResourceQuotaBytes
gRPC trafficgrpcRequestsTotal, grpcResponsesTotal, grpcActiveRequests, grpcErrorsTotal, grpcBatchPutItemsTotal, grpcBatchGetItemsTotal

The API metrics are useful for boundary tests and service deployments. Embedded-only users can ignore them when api.enabled is false.

CheckSignal
Read path healthgetsMemtableHit + getsSstHit should explain most of getsTotal unless misses are expected.
Flush pressurememtable.approxBytes near threshold and frequent flushes indicate write pressure.
Compaction pressureRising sst.l0FileCount, compactionPending, or l0Stalls.
WAL groupingIn async mode, batchesFlushed should be meaningfully lower than entriesWritten.
Blob growthblob.bytesOnDisk growing faster than live data may require GC review.
History backlogvlog.pendingBytes approaching vlog.asyncMaxPendingBytes.