Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Add metric to capture memory used by RocksDB table readers #1108

Merged
merged 2 commits into from
Mar 19, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,19 @@ private RocksDbKeyValueStorage(final Path storageDirectory, final MetricsSystem
metricsSystem.createTimer(
MetricCategory.ROCKSDB, "commit_latency_seconds", "Latency for commits to RocksDB.");

metricsSystem.createLongGauge(
MetricCategory.ROCKSDB,
"rocks_db_table_readers_memory_bytes",
"Estimated memory used for RocksDB index and filter blocks in bytes",
() -> {
try {
return db.getLongProperty("rocksdb.estimate-table-readers-mem");
} catch (final RocksDBException e) {
LOG.debug("Failed to get RocksDB metric", e);
return 0L;
}
});

rollbackCount =
metricsSystem.createCounter(
MetricCategory.ROCKSDB,
Expand Down