aboutsummaryrefslogtreecommitdiff
path: root/src/table/data.rs
diff options
context:
space:
mode:
authorMaximilien R <maximilien@deuxfleurs.fr>2022-02-15 20:09:43 +0100
committerAlex Auvolat <alex@adnab.me>2022-03-14 10:51:17 +0100
commit1e2cf26373ef1812a3152a0057774f6381e66914 (patch)
tree1212796b28762f404f71702a59b5384e69bc4e87 /src/table/data.rs
parente349af13a7268d567c1bacc819af5b89c2d4231f (diff)
downloadgarage-1e2cf26373ef1812a3152a0057774f6381e66914.tar.gz
garage-1e2cf26373ef1812a3152a0057774f6381e66914.zip
Implement basic metrics in table
Diffstat (limited to 'src/table/data.rs')
-rw-r--r--src/table/data.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/table/data.rs b/src/table/data.rs
index d7787b6b..a5209c26 100644
--- a/src/table/data.rs
+++ b/src/table/data.rs
@@ -13,6 +13,7 @@ use garage_rpc::system::System;
use crate::crdt::Crdt;
use crate::gc::GcTodoEntry;
+use crate::metrics::*;
use crate::replication::*;
use crate::schema::*;
@@ -28,6 +29,8 @@ pub struct TableData<F: TableSchema, R: TableReplication> {
pub(crate) merkle_todo: sled::Tree,
pub(crate) merkle_todo_notify: Notify,
pub(crate) gc_todo: sled::Tree,
+
+ pub(crate) metrics: TableMetrics,
}
impl<F, R> TableData<F, R>
@@ -51,6 +54,8 @@ where
.open_tree(&format!("{}:gc_todo_v2", F::TABLE_NAME))
.expect("Unable to open DB tree");
+ let metrics = TableMetrics::new(F::TABLE_NAME, merkle_todo.clone());
+
Arc::new(Self {
system,
instance,
@@ -60,6 +65,7 @@ where
merkle_todo,
merkle_todo_notify: Notify::new(),
gc_todo,
+ metrics,
})
}