@harperfast/rocksdb-js 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/stats.md ADDED
@@ -0,0 +1,459 @@
1
+ # Stats
2
+
3
+ ## Overview
4
+
5
+ `rocksdb-js` provides database-level RocksDB and transaction log stats using
6
+ `db.getStats()` or `db.getStat(statName)` as well as per-store transaction log
7
+ stats using `log.getStats()`.
8
+
9
+ There are three types of stats:
10
+
11
+ - **tickers** - 64-bit unsigned integer counters that only ever increase (lifetime totals)
12
+ - **gauges** - point-in-time values (current sizes, counts, and ages) that can go up or down
13
+ - **histograms** - objects describing the distribution of a measurement across operations
14
+
15
+ Certain stats are only available when `enableStats` is `true` when the database was opened.
16
+
17
+ ## Database Stats
18
+
19
+ ```typescript
20
+ const db: RocksDatabase = RocksDatabase.open('path/to/db');
21
+
22
+ const basicStats: StatsDefault = db.getStats();
23
+ // or
24
+ const allStats: StatsAll = db.getStats(true);
25
+
26
+ // get a single stat
27
+ const keysWritten: number = db.getStat('rocksdb.number.keys.written');
28
+ const keysWrittenHistogram: StatsHistogramData = db.getStat('rocksdb.db.flush.micros');
29
+ ```
30
+
31
+ ### Basic Stats
32
+
33
+ By default, `db.getStats()` returns properties only.
34
+
35
+ | Name | Description | Type |
36
+ | ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
37
+ | `rocksdb.block-cache-capacity` | Capacity in bytes of the block cache. | gauge |
38
+ | `rocksdb.block-cache-pinned-usage` | Bytes occupied by pinned block cache entries. | gauge |
39
+ | `rocksdb.block-cache-usage` | Bytes currently used by block cache entries. | gauge |
40
+ | `rocksdb.compaction-pending` | `1` if at least one compaction is pending, else `0`. | gauge |
41
+ | `rocksdb.cur-size-active-mem-table` | Approximate size in bytes of the active memtable. | gauge |
42
+ | `rocksdb.cur-size-all-mem-tables` | Approximate size in bytes of the active and unflushed immutable memtables. | gauge |
43
+ | `rocksdb.current-super-version-number` | Current super-version number, incremented on each LSM change. | gauge |
44
+ | `rocksdb.estimate-live-data-size` | Estimated size in bytes of the live data. | gauge |
45
+ | `rocksdb.estimate-num-keys` | Estimated number of live keys. | gauge |
46
+ | `rocksdb.estimate-pending-compaction-bytes` | Estimated bytes compaction must rewrite to rebalance the LSM tree. | gauge |
47
+ | `rocksdb.live-blob-file-size` | Total size in bytes of blob files in the current version. | gauge |
48
+ | `rocksdb.live-sst-files-size` | Total size in bytes of SST files in the current version. | gauge |
49
+ | `rocksdb.mem-table-flush-pending` | `1` if a memtable flush is pending, else `0`. | gauge |
50
+ | `rocksdb.num-blob-files` | Number of blob files in the current version. | gauge |
51
+ | `rocksdb.num-deletes-active-mem-table` | Number of delete entries in the active memtable. | gauge |
52
+ | `rocksdb.num-entries-active-mem-table` | Number of entries in the active memtable. | gauge |
53
+ | `rocksdb.num-immutable-mem-table` | Number of immutable memtables not yet flushed. | gauge |
54
+ | `rocksdb.num-immutable-mem-table-flushed` | Number of immutable memtables already flushed. | gauge |
55
+ | `rocksdb.num-live-versions` | Number of live LSM versions (high values indicate versions held by iterators/snapshots). | gauge |
56
+ | `rocksdb.num-running-compactions` | Number of compactions currently running. | gauge |
57
+ | `rocksdb.num-running-flushes` | Number of flushes currently running. | gauge |
58
+ | `rocksdb.oldest-snapshot-time` | Unix timestamp of the oldest unreleased snapshot, or `0`. | gauge |
59
+ | `rocksdb.size-all-mem-tables` | Approximate size in bytes of active, unflushed, and pinned memtables. | gauge |
60
+ | `rocksdb.total-blob-file-size` | Total size in bytes of all blob files across all versions. | gauge |
61
+ | `rocksdb.total-sst-files-size` | Total size in bytes of all SST files across all versions. | gauge |
62
+ | `txnlog.activeMaps` | Number of transaction log files currently memory-mapped, summed across all logs. | gauge |
63
+ | `txnlog.bytesWritten` | Cumulative bytes written to transaction logs (entry payload plus entry header, excluding file headers), summed across all logs. | ticker |
64
+ | `txnlog.fileCount` | Total number of transaction log files on disk, summed across all logs. | gauge |
65
+ | `txnlog.logCount` | Number of transaction log stores attached to the database. | gauge |
66
+ | `txnlog.mappedBytes` | Virtual address space in bytes reserved for memory-mapped log files, summed across all logs (on POSIX the active write file maps the full configured `maxFileSize`, so this is allocated address space, not resident memory). | gauge |
67
+ | `txnlog.overlayBytes` | File-backed overlay portion in bytes (POSIX only; `0` on Windows), summed across all logs — a closer proxy for real memory consumption than `mappedBytes`. | gauge |
68
+ | `txnlog.pendingTransactions` | Number of transactions bound to a log but not yet written via `writeBatch()`, summed across all logs. | gauge |
69
+ | `txnlog.replayGapBytes` | Bytes between the last flushed position and the write head (written but not yet flushed to the database), summed across all logs. | gauge |
70
+ | `txnlog.totalSizeBytes` | Total on-disk size in bytes of all transaction log files, summed across all logs. | gauge |
71
+ | `txnlog.transactionsWritten` | Cumulative number of transactions successfully written to the logs (lifetime total), summed across all logs. | ticker |
72
+ | `txnlog.uncommittedTransactions` | Number of transactions written to a log but not yet committed to RocksDB, summed across all logs. | gauge |
73
+
74
+ ### Basic + Curated Stats
75
+
76
+ If `enableStats` is `true` when the database was opened, then `db.getStats()`
77
+ returns everything above plus the following curated list of stats:
78
+
79
+ | Name | Description | Type |
80
+ | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | --------- |
81
+ | `rocksdb.blobdb.value.size` | Distribution of blob value sizes. | histogram |
82
+ | `rocksdb.block.cache.data.hit` | Block cache hits for data blocks. | ticker |
83
+ | `rocksdb.block.cache.data.miss` | Block cache misses for data blocks. | ticker |
84
+ | `rocksdb.block.cache.filter.hit` | Block cache hits for filter blocks. | ticker |
85
+ | `rocksdb.block.cache.filter.miss` | Block cache misses for filter blocks. | ticker |
86
+ | `rocksdb.block.cache.hit` | Total block cache hits across all block types. | ticker |
87
+ | `rocksdb.block.cache.index.hit` | Block cache hits for index blocks. | ticker |
88
+ | `rocksdb.block.cache.index.miss` | Block cache misses for index blocks. | ticker |
89
+ | `rocksdb.block.cache.miss` | Total block cache misses across all block types. | ticker |
90
+ | `rocksdb.bloom.filter.full.positive` | Times a full bloom filter reported a key as possibly present. | ticker |
91
+ | `rocksdb.bloom.filter.full.true.positive` | Times a full bloom filter positive turned out to be a true positive (the key actually existed). | ticker |
92
+ | `rocksdb.bloom.filter.useful` | Times the bloom filter avoided reading a data block for a non-existent key. | ticker |
93
+ | `rocksdb.bytes.read` | Total uncompressed bytes read by `Get()`, `MultiGet()`, and iterator operations. | ticker |
94
+ | `rocksdb.bytes.written` | Total uncompressed bytes written via `WriteBatch` payloads. | ticker |
95
+ | `rocksdb.compact.read.bytes` | Bytes read during compaction. | ticker |
96
+ | `rocksdb.compact.write.bytes` | Bytes written during compaction. | ticker |
97
+ | `rocksdb.compaction.cancelled` | Number of compactions cancelled (e.g. on shutdown or manual cancellation). | ticker |
98
+ | `rocksdb.compaction.times.micros` | Distribution of total compaction durations (microseconds). | histogram |
99
+ | `rocksdb.db.flush.micros` | Distribution of memtable flush durations (microseconds). | histogram |
100
+ | `rocksdb.db.get.micros` | Distribution of `Get()` latencies (microseconds). | histogram |
101
+ | `rocksdb.db.iter.bytes.read` | Total bytes (key plus value) read through iterators. | ticker |
102
+ | `rocksdb.db.seek.micros` | Distribution of iterator `Seek()` / `SeekToFirst()` / `SeekToLast()` latencies (microseconds). | histogram |
103
+ | `rocksdb.db.write.micros` | Distribution of `Write()` latencies (microseconds). | histogram |
104
+ | `rocksdb.db.write.stall` | Distribution of write stall durations (microseconds). | histogram |
105
+ | `rocksdb.memtable.hit` | Number of reads served from the memtable. | ticker |
106
+ | `rocksdb.memtable.miss` | Number of reads that missed the memtable and fell through to SST files. | ticker |
107
+ | `rocksdb.no.file.errors` | Number of errors encountered while reading from files. | ticker |
108
+ | `rocksdb.number.keys.read` | Total number of keys read via `Get()` and `MultiGet()`. | ticker |
109
+ | `rocksdb.number.keys.written` | Total number of keys written. | ticker |
110
+ | `rocksdb.number.reseeks.iteration` | Number of internal reseeks performed during iteration (e.g. skipping past many tombstones or stale versions). | ticker |
111
+ | `rocksdb.read.amp.estimate.useful.bytes` | Estimated useful bytes read (read-amplification accounting; requires `read_amp_bytes_per_bit`). | ticker |
112
+ | `rocksdb.read.amp.total.read.bytes` | Total bytes read (read-amplification accounting). | ticker |
113
+ | `rocksdb.sst.read.micros` | Distribution of SST file read latencies (microseconds). | histogram |
114
+ | `rocksdb.stall.micros` | Total microseconds writes were stalled. | ticker |
115
+ | `rocksdb.txn.overhead.mutex.old.commit.map` | Number of times the old-commit-map mutex was acquired for pessimistic-transaction commit bookkeeping (overhead accounting). | ticker |
116
+ | `rocksdb.txn.overhead.mutex.prepare` | Number of times the prepare-heap mutex was acquired for pessimistic-transaction prepare bookkeeping (overhead accounting). | ticker |
117
+ | `rocksdb.txn.overhead.mutex.snapshot` | Number of times the snapshot-list mutex was acquired for pessimistic-transaction snapshot bookkeeping (overhead accounting). | ticker |
118
+
119
+ ### All Stats
120
+
121
+ If `enableStats` is `true`, calling `db.getStats(true)` returns all stats,
122
+ which includes all of the stats above plus the following:
123
+
124
+ | Name | Description | Type |
125
+ | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------- | --------- |
126
+ | `rocksdb.async.prefetch.abort.micros` | Distribution of time spent aborting outstanding async prefetch requests (microseconds). | histogram |
127
+ | `rocksdb.async.read.bytes` | Distribution of bytes read per asynchronous read request. | histogram |
128
+ | `rocksdb.async.read.error.count` | Number of errors returned by asynchronous read requests. | ticker |
129
+ | `rocksdb.backup.read.bytes` | Bytes read while creating backups. | ticker |
130
+ | `rocksdb.backup.write.bytes` | Bytes written while creating backups. | ticker |
131
+ | `rocksdb.blobdb.blob.file.bytes.read` | Bytes read from blob files. | ticker |
132
+ | `rocksdb.blobdb.blob.file.bytes.written` | Bytes written to blob files. | ticker |
133
+ | `rocksdb.blobdb.blob.file.read.micros` | Distribution of blob file read latencies (microseconds). | histogram |
134
+ | `rocksdb.blobdb.blob.file.sync.micros` | Distribution of blob file sync latencies (microseconds). | histogram |
135
+ | `rocksdb.blobdb.blob.file.synced` | Number of blob file syncs. | ticker |
136
+ | `rocksdb.blobdb.blob.file.write.micros` | Distribution of blob file write latencies (microseconds). | histogram |
137
+ | `rocksdb.blobdb.blob.index.evicted.count` | Number of blob index entries evicted from the base DB by garbage collection (legacy stacked BlobDB). | ticker |
138
+ | `rocksdb.blobdb.blob.index.evicted.size` | Size in bytes of blobs evicted by garbage collection (legacy stacked BlobDB). | ticker |
139
+ | `rocksdb.blobdb.blob.index.expired.count` | Number of blobs expired due to TTL (legacy stacked BlobDB). | ticker |
140
+ | `rocksdb.blobdb.blob.index.expired.size` | Size in bytes of blobs expired due to TTL (legacy stacked BlobDB). | ticker |
141
+ | `rocksdb.blobdb.bytes.read` | Total bytes read from blobs (legacy stacked BlobDB). | ticker |
142
+ | `rocksdb.blobdb.bytes.written` | Total bytes written to blobs (legacy stacked BlobDB). | ticker |
143
+ | `rocksdb.blobdb.cache.add` | Number of blobs added to the blob cache. | ticker |
144
+ | `rocksdb.blobdb.cache.add.failures` | Number of failures adding blobs to the blob cache. | ticker |
145
+ | `rocksdb.blobdb.cache.bytes.read` | Bytes read from the blob cache. | ticker |
146
+ | `rocksdb.blobdb.cache.bytes.write` | Bytes written to the blob cache. | ticker |
147
+ | `rocksdb.blobdb.cache.hit` | Blob cache hits. | ticker |
148
+ | `rocksdb.blobdb.cache.miss` | Blob cache misses. | ticker |
149
+ | `rocksdb.blobdb.compression.micros` | Distribution of blob compression latencies (microseconds). | histogram |
150
+ | `rocksdb.blobdb.decompression.micros` | Distribution of blob decompression latencies (microseconds). | histogram |
151
+ | `rocksdb.blobdb.fifo.bytes.evicted` | Bytes evicted by the FIFO eviction policy (legacy stacked BlobDB). | ticker |
152
+ | `rocksdb.blobdb.fifo.num.files.evicted` | Number of blob files evicted by the FIFO eviction policy (legacy stacked BlobDB). | ticker |
153
+ | `rocksdb.blobdb.fifo.num.keys.evicted` | Number of keys evicted by the FIFO eviction policy (legacy stacked BlobDB). | ticker |
154
+ | `rocksdb.blobdb.gc.bytes.relocated` | Bytes of valid blobs relocated during blob garbage collection. | ticker |
155
+ | `rocksdb.blobdb.gc.failures` | Number of blob garbage collection failures. | ticker |
156
+ | `rocksdb.blobdb.gc.num.files` | Number of blob files obsoleted by garbage collection (legacy stacked BlobDB). | ticker |
157
+ | `rocksdb.blobdb.gc.num.keys.relocated` | Number of valid blobs relocated during blob garbage collection. | ticker |
158
+ | `rocksdb.blobdb.gc.num.new.files` | Number of new blob files generated by garbage collection (legacy stacked BlobDB). | ticker |
159
+ | `rocksdb.blobdb.get.micros` | Distribution of `Get()` latencies (microseconds) (legacy stacked BlobDB). | histogram |
160
+ | `rocksdb.blobdb.key.size` | Distribution of key sizes for BlobDB operations. | histogram |
161
+ | `rocksdb.blobdb.multiget.micros` | Distribution of `MultiGet()` latencies (microseconds) (legacy stacked BlobDB). | histogram |
162
+ | `rocksdb.blobdb.next.micros` | Distribution of iterator `Next()` latencies (microseconds) (legacy stacked BlobDB). | histogram |
163
+ | `rocksdb.blobdb.num.get` | Number of `Get()` calls (legacy stacked BlobDB). | ticker |
164
+ | `rocksdb.blobdb.num.keys.read` | Number of keys read (legacy stacked BlobDB). | ticker |
165
+ | `rocksdb.blobdb.num.keys.written` | Number of keys written (legacy stacked BlobDB). | ticker |
166
+ | `rocksdb.blobdb.num.multiget` | Number of `MultiGet()` calls (legacy stacked BlobDB). | ticker |
167
+ | `rocksdb.blobdb.num.next` | Number of iterator `Next()` calls (legacy stacked BlobDB). | ticker |
168
+ | `rocksdb.blobdb.num.prev` | Number of iterator `Prev()` calls (legacy stacked BlobDB). | ticker |
169
+ | `rocksdb.blobdb.num.put` | Number of `Put()` calls (legacy stacked BlobDB). | ticker |
170
+ | `rocksdb.blobdb.num.seek` | Number of iterator `Seek()` calls (legacy stacked BlobDB). | ticker |
171
+ | `rocksdb.blobdb.num.write` | Number of `Write()` calls (legacy stacked BlobDB). | ticker |
172
+ | `rocksdb.blobdb.prev.micros` | Distribution of iterator `Prev()` latencies (microseconds) (legacy stacked BlobDB). | histogram |
173
+ | `rocksdb.blobdb.seek.micros` | Distribution of iterator `Seek()` latencies (microseconds) (legacy stacked BlobDB). | histogram |
174
+ | `rocksdb.blobdb.write.blob` | Number of (non-TTL) values written to blob files (legacy stacked BlobDB). | ticker |
175
+ | `rocksdb.blobdb.write.blob.ttl` | Number of TTL values written to blob files (legacy stacked BlobDB). | ticker |
176
+ | `rocksdb.blobdb.write.inlined` | Number of (non-TTL) values inlined in the base DB instead of a blob file (legacy stacked BlobDB). | ticker |
177
+ | `rocksdb.blobdb.write.inlined.ttl` | Number of TTL values inlined in the base DB instead of a blob file (legacy stacked BlobDB). | ticker |
178
+ | `rocksdb.blobdb.write.micros` | Distribution of `Write()` latencies (microseconds) (legacy stacked BlobDB). | histogram |
179
+ | `rocksdb.block.cache.add` | Number of blocks added to the block cache. | ticker |
180
+ | `rocksdb.block.cache.add.failures` | Number of failures adding blocks to the block cache. | ticker |
181
+ | `rocksdb.block.cache.add.redundant` | Number of redundant block cache insertions (a block added concurrently by another thread). | ticker |
182
+ | `rocksdb.block.cache.bytes.read` | Bytes read from the block cache. | ticker |
183
+ | `rocksdb.block.cache.bytes.write` | Bytes inserted into the block cache. | ticker |
184
+ | `rocksdb.block.cache.compression.dict.add` | Number of compression-dictionary blocks added to the block cache. | ticker |
185
+ | `rocksdb.block.cache.compression.dict.add.redundant` | Number of redundant compression-dictionary block insertions. | ticker |
186
+ | `rocksdb.block.cache.compression.dict.bytes.insert` | Bytes of compression-dictionary blocks inserted into the block cache. | ticker |
187
+ | `rocksdb.block.cache.compression.dict.hit` | Block cache hits for compression-dictionary blocks. | ticker |
188
+ | `rocksdb.block.cache.compression.dict.miss` | Block cache misses for compression-dictionary blocks. | ticker |
189
+ | `rocksdb.block.cache.data.add` | Number of data blocks added to the block cache. | ticker |
190
+ | `rocksdb.block.cache.data.add.redundant` | Number of redundant data block insertions. | ticker |
191
+ | `rocksdb.block.cache.data.bytes.insert` | Bytes of data blocks inserted into the block cache. | ticker |
192
+ | `rocksdb.block.cache.filter.add` | Number of filter blocks added to the block cache. | ticker |
193
+ | `rocksdb.block.cache.filter.add.redundant` | Number of redundant filter block insertions. | ticker |
194
+ | `rocksdb.block.cache.filter.bytes.insert` | Bytes of filter blocks inserted into the block cache. | ticker |
195
+ | `rocksdb.block.cache.index.add` | Number of index blocks added to the block cache. | ticker |
196
+ | `rocksdb.block.cache.index.add.redundant` | Number of redundant index block insertions. | ticker |
197
+ | `rocksdb.block.cache.index.bytes.insert` | Bytes of index blocks inserted into the block cache. | ticker |
198
+ | `rocksdb.block.checksum.compute.count` | Number of block checksums computed while reading blocks. | ticker |
199
+ | `rocksdb.block.checksum.mismatch.count` | Number of block checksum mismatches detected (corruption). | ticker |
200
+ | `rocksdb.block.key.distribution.cv` | Distribution of the coefficient of variation of key sizes within data blocks. | histogram |
201
+ | `rocksdb.bloom.filter.prefix.checked` | Number of times the prefix bloom filter was checked. | ticker |
202
+ | `rocksdb.bloom.filter.prefix.true.positive` | Number of prefix bloom filter positives that were true positives. | ticker |
203
+ | `rocksdb.bloom.filter.prefix.useful` | Number of times the prefix bloom filter avoided a read. | ticker |
204
+ | `rocksdb.bytes.compressed.from` | Uncompressed input bytes fed into block compression. | ticker |
205
+ | `rocksdb.bytes.compressed.to` | Compressed output bytes produced by block compression. | ticker |
206
+ | `rocksdb.bytes.compression_bypassed` | Uncompressed bytes for blocks that bypassed compression (e.g. below the size threshold). | ticker |
207
+ | `rocksdb.bytes.compression.rejected` | Uncompressed bytes for blocks where compression was rejected for an insufficient ratio. | ticker |
208
+ | `rocksdb.bytes.decompressed.from` | Compressed input bytes fed into block decompression. | ticker |
209
+ | `rocksdb.bytes.decompressed.to` | Uncompressed output bytes produced by block decompression. | ticker |
210
+ | `rocksdb.bytes.per.multiget` | Distribution of total bytes read per `MultiGet()` call. | histogram |
211
+ | `rocksdb.bytes.per.read` | Distribution of bytes read per `Get()` call. | histogram |
212
+ | `rocksdb.bytes.per.write` | Distribution of bytes written per `Write()` call. | histogram |
213
+ | `rocksdb.cold.file.read.bytes` | Bytes read from files with the `cold` temperature. | ticker |
214
+ | `rocksdb.cold.file.read.count` | Number of reads from files with the `cold` temperature. | ticker |
215
+ | `rocksdb.compact.read.marked.bytes` | Bytes read while compacting files marked for compaction. | ticker |
216
+ | `rocksdb.compact.read.periodic.bytes` | Bytes read during periodic compaction. | ticker |
217
+ | `rocksdb.compact.read.ttl.bytes` | Bytes read during TTL-triggered compaction. | ticker |
218
+ | `rocksdb.compact.write.marked.bytes` | Bytes written while compacting files marked for compaction. | ticker |
219
+ | `rocksdb.compact.write.periodic.bytes` | Bytes written during periodic compaction. | ticker |
220
+ | `rocksdb.compact.write.ttl.bytes` | Bytes written during TTL-triggered compaction. | ticker |
221
+ | `rocksdb.compaction.aborted` | Number of compactions aborted. | ticker |
222
+ | `rocksdb.compaction.key.drop.new` | Keys dropped during compaction because a newer version of the key exists. | ticker |
223
+ | `rocksdb.compaction.key.drop.obsolete` | Keys dropped during compaction because they are obsolete (deleted or expired). | ticker |
224
+ | `rocksdb.compaction.key.drop.range_del` | Keys dropped during compaction by range deletions. | ticker |
225
+ | `rocksdb.compaction.key.drop.user` | Keys dropped during compaction by the user-defined compaction filter. | ticker |
226
+ | `rocksdb.compaction.optimized.del.drop.obsolete` | Obsolete keys dropped via the optimized deletion path during compaction. | ticker |
227
+ | `rocksdb.compaction.outfile.sync.micros` | Distribution of compaction output-file sync latencies (microseconds). | histogram |
228
+ | `rocksdb.compaction.prefetch.bytes` | Distribution of bytes prefetched during compaction reads. | histogram |
229
+ | `rocksdb.compaction.range_del.drop.obsolete` | Range-deletion tombstones dropped as obsolete during compaction. | ticker |
230
+ | `rocksdb.compaction.times.cpu_micros` | Distribution of compaction CPU times (microseconds). | histogram |
231
+ | `rocksdb.compaction.total.time.cpu_micros` | Total CPU time spent in compaction (microseconds). | ticker |
232
+ | `rocksdb.compressed.secondary.cache.dummy.hits` | Dummy (placeholder) hits in the compressed secondary cache. | ticker |
233
+ | `rocksdb.compressed.secondary.cache.hits` | Hits in the compressed secondary cache. | ticker |
234
+ | `rocksdb.compressed.secondary.cache.promotion.skips` | Entries not promoted from the compressed secondary cache to the primary cache. | ticker |
235
+ | `rocksdb.compressed.secondary.cache.promotions` | Entries promoted from the compressed secondary cache to the primary cache. | ticker |
236
+ | `rocksdb.compression.times.nanos` | Distribution of block compression times (nanoseconds). | histogram |
237
+ | `rocksdb.cool.file.read.bytes` | Bytes read from files with the `cool` temperature. | ticker |
238
+ | `rocksdb.cool.file.read.count` | Number of reads from files with the `cool` temperature. | ticker |
239
+ | `rocksdb.db.multiget.micros` | Distribution of `MultiGet()` latencies (microseconds). | histogram |
240
+ | `rocksdb.db.mutex.wait.micros` | Total time threads spent waiting on the DB mutex (microseconds). | ticker |
241
+ | `rocksdb.decompression.times.nanos` | Distribution of block decompression times (nanoseconds). | histogram |
242
+ | `rocksdb.error.handler.autoresume.count` | Number of automatic recovery attempts after a background error. | ticker |
243
+ | `rocksdb.error.handler.autoresume.retry.count` | Distribution of retries per automatic recovery attempt. | histogram |
244
+ | `rocksdb.error.handler.autoresume.retry.total.count` | Total automatic recovery retries across all attempts. | ticker |
245
+ | `rocksdb.error.handler.autoresume.success.count` | Number of successful automatic recoveries. | ticker |
246
+ | `rocksdb.error.handler.bg.error.count` | Number of background errors flagged by the error handler. | ticker |
247
+ | `rocksdb.error.handler.bg.io.error.count` | Number of background I/O errors flagged by the error handler. | ticker |
248
+ | `rocksdb.error.handler.bg.retryable.io.error.count` | Number of retryable background I/O errors flagged by the error handler. | ticker |
249
+ | `rocksdb.fifo.change_temperature.compactions` | Number of FIFO compactions triggered to change file temperature. | ticker |
250
+ | `rocksdb.fifo.max.size.compactions` | Number of FIFO compactions triggered by exceeding the maximum size. | ticker |
251
+ | `rocksdb.fifo.ttl.compactions` | Number of FIFO compactions triggered by TTL. | ticker |
252
+ | `rocksdb.file.read.compaction.micros` | Distribution of file read latencies during compaction (microseconds). | histogram |
253
+ | `rocksdb.file.read.corruption.retry.count` | Number of file read retries triggered by corruption. | ticker |
254
+ | `rocksdb.file.read.corruption.retry.success.count` | Number of file read corruption retries that succeeded. | ticker |
255
+ | `rocksdb.file.read.db.iterator.micros` | Distribution of file read latencies during iteration (microseconds). | histogram |
256
+ | `rocksdb.file.read.db.open.micros` | Distribution of file read latencies during DB open (microseconds). | histogram |
257
+ | `rocksdb.file.read.flush.micros` | Distribution of file read latencies during flush (microseconds). | histogram |
258
+ | `rocksdb.file.read.get.micros` | Distribution of file read latencies during `Get()` (microseconds). | histogram |
259
+ | `rocksdb.file.read.multiget.micros` | Distribution of file read latencies during `MultiGet()` (microseconds). | histogram |
260
+ | `rocksdb.file.read.verify.db.checksum.micros` | Distribution of file read latencies during full-DB checksum verification (microseconds). | histogram |
261
+ | `rocksdb.file.read.verify.file.checksums.micros` | Distribution of file read latencies during per-file checksum verification (microseconds). | histogram |
262
+ | `rocksdb.file.write.compaction.micros` | Distribution of file write latencies during compaction (microseconds). | histogram |
263
+ | `rocksdb.file.write.db.open.micros` | Distribution of file write latencies during DB open (microseconds). | histogram |
264
+ | `rocksdb.file.write.flush.micros` | Distribution of file write latencies during flush (microseconds). | histogram |
265
+ | `rocksdb.files.deleted.immediately` | Number of files deleted immediately rather than via rate-limited (trash) deletion. | ticker |
266
+ | `rocksdb.files.marked.trash` | Number of files marked as trash for rate-limited deletion. | ticker |
267
+ | `rocksdb.files.marked.trash.deleted` | Number of trash-marked files that were subsequently deleted. | ticker |
268
+ | `rocksdb.filter.operation.time.nanos` | Total time spent in filter operations (nanoseconds). | ticker |
269
+ | `rocksdb.flush.write.bytes` | Bytes written by memtable flushes. | ticker |
270
+ | `rocksdb.footer.corruption.count` | Number of SST footer corruptions detected. | ticker |
271
+ | `rocksdb.getupdatessince.calls` | Number of `GetUpdatesSince()` calls (WAL reads, e.g. for replication). | ticker |
272
+ | `rocksdb.hot.file.read.bytes` | Bytes read from files with the `hot` temperature. | ticker |
273
+ | `rocksdb.hot.file.read.count` | Number of reads from files with the `hot` temperature. | ticker |
274
+ | `rocksdb.ice.file.read.bytes` | Bytes read from files with the `ice` temperature. | ticker |
275
+ | `rocksdb.ice.file.read.count` | Number of reads from files with the `ice` temperature. | ticker |
276
+ | `rocksdb.l0.hit` | Number of `Get()` reads satisfied at level 0. | ticker |
277
+ | `rocksdb.l1.hit` | Number of `Get()` reads satisfied at level 1. | ticker |
278
+ | `rocksdb.l2andup.hit` | Number of `Get()` reads satisfied at level 2 or higher. | ticker |
279
+ | `rocksdb.last.level.read.bytes` | Bytes read from the last (bottommost) level. | ticker |
280
+ | `rocksdb.last.level.read.count` | Number of reads from the last (bottommost) level. | ticker |
281
+ | `rocksdb.last.level.seek.data` | Number of seeks that accessed data in the last level. | ticker |
282
+ | `rocksdb.last.level.seek.data.useful.filter.match` | Last-level seeks that returned useful data following a filter match. | ticker |
283
+ | `rocksdb.last.level.seek.data.useful.no.filter` | Last-level seeks that returned useful data with no filter present. | ticker |
284
+ | `rocksdb.last.level.seek.filter.match` | Last-level seeks where the bloom filter matched. | ticker |
285
+ | `rocksdb.last.level.seek.filtered` | Last-level seeks filtered out by the bloom filter. | ticker |
286
+ | `rocksdb.manifest.file.sync.micros` | Distribution of MANIFEST file sync latencies (microseconds). | histogram |
287
+ | `rocksdb.memtable.garbage.bytes.at.flush` | Bytes of garbage (overwritten or deleted entries) in the memtable at flush time. | ticker |
288
+ | `rocksdb.memtable.payload.bytes.at.flush` | Bytes of live payload in the memtable at flush time. | ticker |
289
+ | `rocksdb.merge.operation.time.nanos` | Total time spent in merge operator operations (nanoseconds). | ticker |
290
+ | `rocksdb.multiget.coroutine.count` | Number of `MultiGet` operations using the coroutine-based async path. | ticker |
291
+ | `rocksdb.multiget.io.batch.size` | Distribution of I/O batch sizes for `MultiGet`. | histogram |
292
+ | `rocksdb.multiscan.blocks.from.cache` | Number of blocks served from cache during multi-scan operations. | ticker |
293
+ | `rocksdb.multiscan.blocks.per.prepare` | Distribution of blocks accessed per multi-scan prepare. | histogram |
294
+ | `rocksdb.multiscan.blocks.prefetched` | Number of blocks prefetched for multi-scan operations. | ticker |
295
+ | `rocksdb.multiscan.io.coalesced.nonadjacent` | Number of non-adjacent I/O requests coalesced during multi-scan. | ticker |
296
+ | `rocksdb.multiscan.io.requests` | Number of I/O requests issued for multi-scan operations. | ticker |
297
+ | `rocksdb.multiscan.op.prepare.iterators.micros` | Distribution of time spent preparing iterators for multi-scan (microseconds). | histogram |
298
+ | `rocksdb.multiscan.prefetch.blocks.wasted` | Number of prefetched multi-scan blocks that went unused. | ticker |
299
+ | `rocksdb.multiscan.prefetch.bytes` | Bytes prefetched for multi-scan operations. | ticker |
300
+ | `rocksdb.multiscan.prepare.calls` | Number of multi-scan prepare calls. | ticker |
301
+ | `rocksdb.multiscan.prepare.errors` | Number of errors encountered during multi-scan prepare. | ticker |
302
+ | `rocksdb.multiscan.prepare.micros` | Distribution of multi-scan prepare latencies (microseconds). | histogram |
303
+ | `rocksdb.multiscan.seek.errors` | Number of seek errors during multi-scan. | ticker |
304
+ | `rocksdb.no.file.opens` | Number of successful SST file opens. | ticker |
305
+ | `rocksdb.non.last.level.read.bytes` | Bytes read from non-last (non-bottommost) levels. | ticker |
306
+ | `rocksdb.non.last.level.read.count` | Number of reads from non-last (non-bottommost) levels. | ticker |
307
+ | `rocksdb.non.last.level.seek.data` | Number of seeks that accessed data in non-last levels. | ticker |
308
+ | `rocksdb.non.last.level.seek.data.useful.filter.match` | Non-last-level seeks that returned useful data following a filter match. | ticker |
309
+ | `rocksdb.non.last.level.seek.data.useful.no.filter` | Non-last-level seeks that returned useful data with no filter present. | ticker |
310
+ | `rocksdb.non.last.level.seek.filter.match` | Non-last-level seeks where the bloom filter matched. | ticker |
311
+ | `rocksdb.non.last.level.seek.filtered` | Non-last-level seeks filtered out by the bloom filter. | ticker |
312
+ | `rocksdb.num.index.and.filter.blocks.read.per.level` | Distribution of index and filter blocks read per level per operation. | histogram |
313
+ | `rocksdb.num.iterator.created` | Number of iterators created. | ticker |
314
+ | `rocksdb.num.iterator.deleted` | Number of iterators destroyed. | ticker |
315
+ | `rocksdb.num.level.read.per.multiget` | Distribution of levels read per `MultiGet` call. | histogram |
316
+ | `rocksdb.num.op.per.transaction` | Distribution of operations per transaction. | histogram |
317
+ | `rocksdb.num.sst.read.per.level` | Distribution of SST files read per level per operation. | histogram |
318
+ | `rocksdb.num.subcompactions.scheduled` | Distribution of subcompactions scheduled per compaction. | histogram |
319
+ | `rocksdb.number.block_compression_bypassed` | Number of blocks that bypassed compression. | ticker |
320
+ | `rocksdb.number.block_compression_rejected` | Number of blocks where compression was rejected. | ticker |
321
+ | `rocksdb.number.block.compressed` | Number of blocks compressed. | ticker |
322
+ | `rocksdb.number.block.decompressed` | Number of blocks decompressed. | ticker |
323
+ | `rocksdb.number.db.next` | Number of iterator `Next()` calls. | ticker |
324
+ | `rocksdb.number.db.next.found` | Number of iterator `Next()` calls that returned a key. | ticker |
325
+ | `rocksdb.number.db.prev` | Number of iterator `Prev()` calls. | ticker |
326
+ | `rocksdb.number.db.prev.found` | Number of iterator `Prev()` calls that returned a key. | ticker |
327
+ | `rocksdb.number.db.seek` | Number of iterator `Seek()` calls. | ticker |
328
+ | `rocksdb.number.db.seek.found` | Number of iterator `Seek()` calls that landed on a key. | ticker |
329
+ | `rocksdb.number.direct.load.table.properties` | Number of times table properties were loaded directly, bypassing the cache. | ticker |
330
+ | `rocksdb.number.iter.skip` | Number of internal entries skipped during iteration (e.g. tombstones, stale versions). | ticker |
331
+ | `rocksdb.number.keys.updated` | Number of keys updated in place. | ticker |
332
+ | `rocksdb.number.merge.failures` | Number of merge operator failures. | ticker |
333
+ | `rocksdb.number.multiget.bytes.read` | Total bytes read by `MultiGet()` calls. | ticker |
334
+ | `rocksdb.number.multiget.get` | Number of `MultiGet()` calls. | ticker |
335
+ | `rocksdb.number.multiget.keys.found` | Number of keys found by `MultiGet()` calls. | ticker |
336
+ | `rocksdb.number.multiget.keys.read` | Number of keys requested across `MultiGet()` calls. | ticker |
337
+ | `rocksdb.number.rate_limiter.drains` | Number of times the rate limiter was fully drained. | ticker |
338
+ | `rocksdb.number.superversion_acquires` | Number of superversion acquisitions. | ticker |
339
+ | `rocksdb.number.superversion_cleanups` | Number of superversion cleanups. | ticker |
340
+ | `rocksdb.number.superversion_releases` | Number of superversion releases. | ticker |
341
+ | `rocksdb.number.wbwi.ingest` | Number of `WriteBatchWithIndex` entries ingested into the DB. | ticker |
342
+ | `rocksdb.numfiles.in.singlecompaction` | Distribution of the number of files in a single compaction. | histogram |
343
+ | `rocksdb.persistent.cache.hit` | Persistent cache hits. | ticker |
344
+ | `rocksdb.persistent.cache.miss` | Persistent cache misses. | ticker |
345
+ | `rocksdb.poll.wait.micros` | Distribution of time spent polling for async read completion (microseconds). | histogram |
346
+ | `rocksdb.prefetch.bytes` | Bytes prefetched. | ticker |
347
+ | `rocksdb.prefetch.bytes.useful` | Prefetched bytes that were actually used. | ticker |
348
+ | `rocksdb.prefetch.hits` | Number of reads satisfied from prefetched data. | ticker |
349
+ | `rocksdb.prefetch.memory.bytes.granted` | Bytes of prefetch buffer memory granted. | ticker |
350
+ | `rocksdb.prefetch.memory.bytes.released` | Bytes of prefetch buffer memory released. | ticker |
351
+ | `rocksdb.prefetch.memory.requests.blocked` | Number of prefetch memory requests blocked by the memory limit. | ticker |
352
+ | `rocksdb.prefetched.bytes.discarded` | Distribution of prefetched bytes that were discarded unused. | histogram |
353
+ | `rocksdb.read.async.micros` | Total time spent in asynchronous reads (microseconds). | ticker |
354
+ | `rocksdb.read.block.compaction.micros` | Distribution of block read latencies during compaction (microseconds). | histogram |
355
+ | `rocksdb.read.block.get.micros` | Distribution of block read latencies during `Get()` (microseconds). | histogram |
356
+ | `rocksdb.read.num.merge_operands` | Distribution of the number of merge operands read per query. | histogram |
357
+ | `rocksdb.readahead.trimmed` | Number of times the readahead size was trimmed. | ticker |
358
+ | `rocksdb.remote.compact.read.bytes` | Bytes read by remote (offloaded) compactions. | ticker |
359
+ | `rocksdb.remote.compact.resumed.bytes` | Bytes processed by resumed remote compactions. | ticker |
360
+ | `rocksdb.remote.compact.write.bytes` | Bytes written by remote (offloaded) compactions. | ticker |
361
+ | `rocksdb.row.cache.hit` | Row cache hits. | ticker |
362
+ | `rocksdb.row.cache.miss` | Row cache misses. | ticker |
363
+ | `rocksdb.secondary.cache.data.hits` | Secondary cache hits for data blocks. | ticker |
364
+ | `rocksdb.secondary.cache.filter.hits` | Secondary cache hits for filter blocks. | ticker |
365
+ | `rocksdb.secondary.cache.hits` | Total secondary cache hits. | ticker |
366
+ | `rocksdb.secondary.cache.index.hits` | Secondary cache hits for index blocks. | ticker |
367
+ | `rocksdb.sim.block.cache.hit` | Simulated block cache hits (from the cache simulator). | ticker |
368
+ | `rocksdb.sim.block.cache.miss` | Simulated block cache misses (from the cache simulator). | ticker |
369
+ | `rocksdb.sst.batch.size` | Distribution of SST write batch sizes. | histogram |
370
+ | `rocksdb.sst.user.defined.index.load.fail.count` | Number of failures loading user-defined SST indexes. | ticker |
371
+ | `rocksdb.sst.write.micros` | Distribution of SST file write latencies (microseconds). | histogram |
372
+ | `rocksdb.subcompaction.setup.times.micros` | Distribution of subcompaction setup times (microseconds). | histogram |
373
+ | `rocksdb.table.open.io.micros` | Distribution of SST table open I/O latencies (microseconds). | histogram |
374
+ | `rocksdb.table.open.prefetch.tail.hit` | Number of table opens that hit the prefetched file tail. | ticker |
375
+ | `rocksdb.table.open.prefetch.tail.miss` | Number of table opens that missed the prefetched file tail. | ticker |
376
+ | `rocksdb.table.open.prefetch.tail.read.bytes` | Distribution of bytes read while prefetching the SST file tail on open. | histogram |
377
+ | `rocksdb.table.sync.micros` | Distribution of new SST table file sync latencies (microseconds). | histogram |
378
+ | `rocksdb.timestamp.filter.table.checked` | Number of SST tables checked against the timestamp filter. | ticker |
379
+ | `rocksdb.timestamp.filter.table.filtered` | Number of SST tables filtered out by the timestamp filter. | ticker |
380
+ | `rocksdb.txn.get.tryagain` | Number of transaction `Get()` calls that returned `TryAgain` due to a snapshot conflict. | ticker |
381
+ | `rocksdb.txn.overhead.duplicate.key` | Transaction overhead incurred by duplicate-key checks. | ticker |
382
+ | `rocksdb.verify_checksum.read.bytes` | Bytes read during explicit checksum verification. | ticker |
383
+ | `rocksdb.wal.bytes` | Bytes written to the write-ahead log (WAL). | ticker |
384
+ | `rocksdb.wal.file.sync.micros` | Distribution of WAL file sync latencies (microseconds). | histogram |
385
+ | `rocksdb.wal.synced` | Number of WAL syncs. | ticker |
386
+ | `rocksdb.warm.file.read.bytes` | Bytes read from files with the `warm` temperature. | ticker |
387
+ | `rocksdb.warm.file.read.count` | Number of reads from files with the `warm` temperature. | ticker |
388
+ | `rocksdb.write.other` | Number of writes processed on behalf of another thread's write group (as a follower). | ticker |
389
+ | `rocksdb.write.raw.block.micros` | Distribution of raw block write latencies (microseconds). | histogram |
390
+ | `rocksdb.write.self` | Number of writes processed by the calling thread itself (as the write group leader). | ticker |
391
+ | `rocksdb.write.wal` | Number of writes that were written to the WAL. | ticker |
392
+
393
+ ## Transaction Log Stats
394
+
395
+ `log.getStats()` returns a detailed snapshot for a single transaction log store. All sizes are in
396
+ bytes and all timestamps are milliseconds since the Unix epoch.
397
+
398
+ ```typescript
399
+ const db: RocksDatabase = RocksDatabase.open('path/to/db');
400
+ const log: TransactionLog = db.useLog('my-log');
401
+ const stats: TransactionLogStats = log.getStats();
402
+ ```
403
+
404
+ `log.getStats()` returns an object with the following shape:
405
+
406
+ - `name: string` The name of the transaction log store.
407
+ - `path: string` Filesystem path to the log store's directory.
408
+ - `fileCount: number` Number of sequence log files on disk for this log.
409
+ - `currentSequenceNumber: number` Sequence number of the active write file.
410
+ - `oldestSequenceNumber: number` Sequence number of the oldest file still on disk.
411
+ - `totalSizeBytes: number` Total on-disk size of all of this log's files.
412
+ - `currentFileSize: number` Size of the active write file.
413
+ - `pendingTransactions: number` Transactions bound to this log but not yet written via
414
+ `writeBatch()`.
415
+ - `uncommittedTransactions: number` Transactions written to this log but not yet committed to
416
+ RocksDB.
417
+ - `replayGapBytes: number` Bytes between the last flushed position and the write head (written but
418
+ not yet flushed to the database).
419
+ - `memory: object`
420
+ - `mappedBytes: number` Virtual address space reserved for memory-mapped files (the active write
421
+ file maps the full configured `maxFileSize` on POSIX), not resident memory.
422
+ - `overlayBytes: number` File-backed overlay portion (POSIX only; `0` on Windows) — a closer
423
+ proxy for real memory consumption than `mappedBytes`.
424
+ - `activeMaps: number` Number of log files currently memory-mapped.
425
+ - `nextLogPosition: object` Position where the next log entry will be written.
426
+ - `sequence: number` The log file sequence number.
427
+ - `offset: number` The byte offset within that file.
428
+ - `lastFlushedPosition: object` Position up to which data has been flushed to the database.
429
+ - `sequence: number` The log file sequence number.
430
+ - `offset: number` The byte offset within that file.
431
+ - `lastCommittedPosition: object | null` Position of the last transaction committed to RocksDB, or
432
+ `null` if nothing has been committed yet.
433
+ - `sequence: number` The log file sequence number.
434
+ - `offset: number` The byte offset within that file.
435
+ - `purge: object`
436
+ - `oldestFileAgeMs: number` Age in milliseconds of the oldest file on disk.
437
+ - `purgeableFiles: number` Number of files eligible for purge under the retention policy.
438
+ - `retainedUnflushedFiles: number` Number of files past the retention threshold but retained
439
+ because they are unflushed.
440
+ - `lastPurgeMs: number` Timestamp of the last purge scan.
441
+ - `totals: object` Lifetime counters since the log store was created.
442
+ - `transactionsWritten: number` Cumulative number of transactions written to this log.
443
+ - `entriesWritten: number` Cumulative number of entries written to this log.
444
+ - `bytesWritten: number` Cumulative bytes written to this log (entry payload plus entry header,
445
+ excluding file headers).
446
+ - `rotations: number` Number of times the log rotated to a new file.
447
+ - `filesPurged: number` Number of files purged by the retention policy.
448
+ - `bytesPurged: number` Bytes reclaimed by purging files.
449
+ - `purgeRuns: number` Number of purge scans run.
450
+ - `databaseFlushes: number` Number of database flush events observed by this log.
451
+ - `writeFailures: number` Number of write failures encountered by this log.
452
+ - `config: object` The store's configured limits.
453
+ - `maxFileSize: number` Configured maximum size of a single log file.
454
+ - `retentionMs: number` Configured retention period in milliseconds.
455
+ - `maxAgeThreshold: number` Configured age threshold (a float between `0` and `1`) at which files
456
+ become purge-eligible.
457
+
458
+ A summarized subset of these stats is also rolled up into `db.getStats()` under the `txnlog.*`
459
+ keys documented above (summed across all of a database's logs).