From fe6ec9afe3981cf5c299166c547c45d2590441c6 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Thu, 19 Sep 2024 11:10:45 +0200 Subject: [PATCH] Add cache capacity --- src/main/java/it/cavallium/dbengine/client/MemoryStats.java | 4 ++-- .../dbengine/database/disk/LLLocalKeyValueDatabase.java | 1 + .../dbengine/database/memory/LLMemoryKeyValueDatabase.java | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/it/cavallium/dbengine/client/MemoryStats.java b/src/main/java/it/cavallium/dbengine/client/MemoryStats.java index fcd1e37..6dc092e 100644 --- a/src/main/java/it/cavallium/dbengine/client/MemoryStats.java +++ b/src/main/java/it/cavallium/dbengine/client/MemoryStats.java @@ -1,5 +1,5 @@ package it.cavallium.dbengine.client; public record MemoryStats(long estimateTableReadersMem, long sizeAllMemTables, - long curSizeAllMemTables, long estimateNumKeys, long blockCacheUsage, - long blockCachePinnedUsage, long liveVersions) {} + long curSizeAllMemTables, long estimateNumKeys, long blockCacheCapacity, + long blockCacheUsage, long blockCachePinnedUsage, long liveVersions) {} diff --git a/src/main/java/it/cavallium/dbengine/database/disk/LLLocalKeyValueDatabase.java b/src/main/java/it/cavallium/dbengine/database/disk/LLLocalKeyValueDatabase.java index 053c41e..3c5e52d 100644 --- a/src/main/java/it/cavallium/dbengine/database/disk/LLLocalKeyValueDatabase.java +++ b/src/main/java/it/cavallium/dbengine/database/disk/LLLocalKeyValueDatabase.java @@ -1344,6 +1344,7 @@ public class LLLocalKeyValueDatabase extends Backuppable implements LLKeyValueDa db.getAggregatedLongProperty(RocksDBLongProperty.SIZE_ALL_MEM_TABLES.getName()), db.getAggregatedLongProperty(RocksDBLongProperty.CUR_SIZE_ALL_MEM_TABLES.getName()), db.getAggregatedLongProperty(RocksDBLongProperty.ESTIMATE_NUM_KEYS.getName()), + db.getAggregatedLongProperty(RocksDBLongProperty.BLOCK_CACHE_CAPACITY.getName()) / this.handles.size(), db.getAggregatedLongProperty(RocksDBLongProperty.BLOCK_CACHE_USAGE.getName()) / this.handles.size(), db.getAggregatedLongProperty(RocksDBLongProperty.BLOCK_CACHE_PINNED_USAGE.getName()) / this.handles.size(), db.getAggregatedLongProperty(RocksDBLongProperty.NUM_LIVE_VERSIONS.getName()) / this.handles.size() diff --git a/src/main/java/it/cavallium/dbengine/database/memory/LLMemoryKeyValueDatabase.java b/src/main/java/it/cavallium/dbengine/database/memory/LLMemoryKeyValueDatabase.java index 235378d..1e0c39b 100644 --- a/src/main/java/it/cavallium/dbengine/database/memory/LLMemoryKeyValueDatabase.java +++ b/src/main/java/it/cavallium/dbengine/database/memory/LLMemoryKeyValueDatabase.java @@ -79,7 +79,7 @@ public class LLMemoryKeyValueDatabase implements LLKeyValueDatabase { @Override public MemoryStats getMemoryStats() { - return new MemoryStats(0, 0, 0, 0, 0, 0, 1); + return new MemoryStats(0, 0, 0, 0, 0, 0, 0, 1); } @Override