Skip to content

Commit

Permalink
Use better savings estimate for x-trie-log prune (#6577)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
  • Loading branch information
siladu committed Feb 15, 2024
1 parent c913b6d commit 8be243f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ public void run() {
.storageSubCommand
.besuCommand
.dataDir()
.toString()
.concat("/")
.concat(DATABASE_PATH);
.resolve(DATABASE_PATH)
.toString();

RocksDbHelper.printTableHeader(out);

Expand Down Expand Up @@ -120,9 +119,8 @@ public void run() {
.storageSubCommand
.besuCommand
.dataDir()
.toString()
.concat("/")
.concat(DATABASE_PATH);
.resolve(DATABASE_PATH)
.toString();

out.println("Column Family Stats...");
RocksDbHelper.forEachColumnFamily(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,13 @@ private long estimatedSizeOfTrieLogs() {
(rocksdb, cfHandle) -> {
try {
if (Arrays.equals(cfHandle.getName(), TRIE_LOG_STORAGE.getId())) {
// TODO SLD use sst + blob?
estimatedSaving.set(
Long.parseLong(
rocksdb.getProperty(cfHandle, "rocksdb.estimate-live-data-size")));

final long sstSize =
Long.parseLong(rocksdb.getProperty(cfHandle, "rocksdb.total-sst-files-size"));
final long blobSize =
Long.parseLong(rocksdb.getProperty(cfHandle, "rocksdb.total-blob-file-size"));

estimatedSaving.set(sstSize + blobSize);
}
} catch (RocksDBException | NumberFormatException e) {
throw new RuntimeException(e);
Expand Down

0 comments on commit 8be243f

Please sign in to comment.