aboutsummaryrefslogtreecommitdiff
path: root/src/table/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/table/metrics.rs
parent04901093e7315558bdc147d27adc3f56ec2c98a1 (diff)
downloadgarage-9f0f5b2e372a720a807914747fd48ddc93928e04.tar.gz
garage-9f0f5b2e372a720a807914747fd48ddc93928e04.zip
Adapt Garage to use new DB abstraction
Diffstat (limited to 'src/table/metrics.rs')
-rw-r--r--src/table/metrics.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/table/metrics.rs b/src/table/metrics.rs
index 752a2a6d..3318de88 100644
--- a/src/table/metrics.rs
+++ b/src/table/metrics.rs
@@ -1,6 +1,6 @@
use opentelemetry::{global, metrics::*, KeyValue};
-use garage_util::sled_counter::SledCountedTree;
+use garage_db as db;
/// TableMetrics reference all counter used for metrics
pub struct TableMetrics {
@@ -19,11 +19,7 @@ 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: SledCountedTree,
- ) -> Self {
+ pub fn new(table_name: &'static str, merkle_todo: db::Tree, gc_todo: db::Tree) -> Self {
let meter = global::meter(table_name);
TableMetrics {
_merkle_todo_len: meter
@@ -31,7 +27,7 @@ impl TableMetrics {
"table.merkle_updater_todo_queue_length",
move |observer| {
observer.observe(
- merkle_todo.len() as u64,
+ merkle_todo.len().unwrap() as u64, // TODO fix unwrap
&[KeyValue::new("table_name", table_name)],
)
},
@@ -43,7 +39,7 @@ impl TableMetrics {
"table.gc_todo_queue_length",
move |observer| {
observer.observe(
- gc_todo.len() as u64,
+ gc_todo.len().unwrap() as u64, // TODO fix unwrap
&[KeyValue::new("table_name", table_name)],
)
},