aboutsummaryrefslogtreecommitdiff
path: root/src/block/metrics.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-02 16:58:00 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-02 16:58:00 +0200
commit9f0f5b2e372a720a807914747fd48ddc93928e04 (patch)
treea4346766c46469758b9138a09c65fa052e9ad253 /src/block/metrics.rs
parent04901093e7315558bdc147d27adc3f56ec2c98a1 (diff)
downloadgarage-9f0f5b2e372a720a807914747fd48ddc93928e04.tar.gz
garage-9f0f5b2e372a720a807914747fd48ddc93928e04.zip
Adapt Garage to use new DB abstraction
Diffstat (limited to 'src/block/metrics.rs')
-rw-r--r--src/block/metrics.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/block/metrics.rs b/src/block/metrics.rs
index f0f541a3..1d4d0028 100644
--- a/src/block/metrics.rs
+++ b/src/block/metrics.rs
@@ -1,6 +1,6 @@
use opentelemetry::{global, metrics::*};
-use garage_util::sled_counter::SledCountedTree;
+use garage_db as db;
/// TableMetrics reference all counter used for metrics
pub struct BlockManagerMetrics {
@@ -23,12 +23,12 @@ pub struct BlockManagerMetrics {
}
impl BlockManagerMetrics {
- pub fn new(resync_queue: SledCountedTree, resync_errors: SledCountedTree) -> Self {
+ pub fn new(resync_queue: db::Tree, resync_errors: db::Tree) -> Self {
let meter = global::meter("garage_model/block");
Self {
_resync_queue_len: meter
.u64_value_observer("block.resync_queue_length", move |observer| {
- observer.observe(resync_queue.len() as u64, &[])
+ observer.observe(resync_queue.len().unwrap() as u64, &[]) // TODO fix unwrap
})
.with_description(
"Number of block hashes queued for local check and possible resync",
@@ -36,7 +36,7 @@ impl BlockManagerMetrics {
.init(),
_resync_errored_blocks: meter
.u64_value_observer("block.resync_errored_blocks", move |observer| {
- observer.observe(resync_errors.len() as u64, &[])
+ observer.observe(resync_errors.len().unwrap() as u64, &[]) // TODO fix unwrap
})
.with_description("Number of block hashes whose last resync resulted in an error")
.init(),