From 8e3cdbdf907f41c746f0d2aff717246efeeb9e11 Mon Sep 17 00:00:00 2001 From: Alexey Pashinov Date: Thu, 13 Feb 2025 13:12:24 +0100 Subject: [PATCH] feat(storage): add metric to monitor available split block tasks --- scripts/gen-dashboard.py | 6 ++++++ storage/src/store/block/mod.rs | 3 +++ 2 files changed, 9 insertions(+) diff --git a/scripts/gen-dashboard.py b/scripts/gen-dashboard.py index a8695d3b1..502841582 100644 --- a/scripts/gen-dashboard.py +++ b/scripts/gen-dashboard.py @@ -840,6 +840,12 @@ def storage() -> RowPanel: create_heatmap_panel( "tycho_storage_cell_in_mem_store_time", "Time to store cell without write" ), + create_heatmap_quantile_panel( + "tycho_storage_split_block_available_permits", + "Split block available permits", + UNITS.NUMBER_FORMAT, + "0.999", + ), create_heatmap_panel( "tycho_storage_batch_write_time", "Time to write merge in write batch" ), diff --git a/storage/src/store/block/mod.rs b/storage/src/store/block/mod.rs index 6c0300039..ea8367534 100644 --- a/storage/src/store/block/mod.rs +++ b/storage/src/store/block/mod.rs @@ -1032,6 +1032,9 @@ impl BlockStorage { self.db.rocksdb().write(batch)?; // Start splitting block data + metrics::histogram!("tycho_storage_split_block_available_permits") + .record(self.split_block_semaphore.available_permits() as f64); + let permit = self.split_block_semaphore.clone().acquire_owned().await?; let _handle = self.spawn_split_block_data(&id.block_id, data, permit);