diff options
author | Alex Auvolat <alex@adnab.me> | 2022-02-24 14:59:49 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-03-14 10:54:25 +0100 |
commit | 2377a92f6b64165be84f53722f30c21e9c8a0b3e (patch) | |
tree | 4a45feb7bd73bd541cc5f8552423cb9d46c8e26d /src/table/metrics.rs | |
parent | 203e8d2c345dabee56e31aebf88b706df5aa72e5 (diff) | |
download | garage-2377a92f6b64165be84f53722f30c21e9c8a0b3e.tar.gz garage-2377a92f6b64165be84f53722f30c21e9c8a0b3e.zip |
Add wrapper over sled tree to count items (used for big queues)
Diffstat (limited to 'src/table/metrics.rs')
-rw-r--r-- | src/table/metrics.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/table/metrics.rs b/src/table/metrics.rs index 548bf0d6..752a2a6d 100644 --- a/src/table/metrics.rs +++ b/src/table/metrics.rs @@ -1,5 +1,7 @@ use opentelemetry::{global, metrics::*, KeyValue}; +use garage_util::sled_counter::SledCountedTree; + /// TableMetrics reference all counter used for metrics pub struct TableMetrics { pub(crate) _merkle_todo_len: ValueObserver<u64>, @@ -17,7 +19,11 @@ pub struct TableMetrics { pub(crate) sync_items_received: Counter<u64>, } impl TableMetrics { - pub fn new(table_name: &'static str, merkle_todo: sled::Tree, gc_todo: sled::Tree) -> Self { + pub fn new( + table_name: &'static str, + merkle_todo: sled::Tree, + gc_todo: SledCountedTree, + ) -> Self { let meter = global::meter(table_name); TableMetrics { _merkle_todo_len: meter |