Skip to content

Commit

Permalink
Implement fast slow metrics.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusSorealheis committed Sep 9, 2023
1 parent 65b8f0e commit 10d2618
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cas/store/BUILD
Expand Up @@ -156,6 +156,7 @@ rust_library(
"//util:buf_channel",
"//util:common",
"//util:error",
"//util:metrics_utils",
"@crate_index//:futures",
],
)
Expand Down
8 changes: 8 additions & 0 deletions cas/store/fast_slow_store.rs
Expand Up @@ -21,6 +21,7 @@ use futures::{join, FutureExt};
use buf_channel::{make_buf_channel_pair, DropCloserReadHalf, DropCloserWriteHalf};
use common::DigestInfo;
use error::{make_err, Code, Error, ResultExt};
use metrics_utils::Registry;
use traits::{StoreTrait, UploadSizeInfo};

// TODO(blaise.bruer) This store needs to be evaluated for more efficient memory usage,
Expand Down Expand Up @@ -239,4 +240,11 @@ impl StoreTrait for FastSlowStore {
fn as_any(self: Arc<Self>) -> Box<dyn std::any::Any + Send> {
Box::new(self)
}

fn register_metrics(self: Arc<Self>, registry: &mut Registry) {
let fast_store_registry = registry.sub_registry_with_prefix("fast");
self.fast_store.clone().register_metrics(fast_store_registry);
let slow_store_registry = registry.sub_registry_with_prefix("slow");
self.slow_store.clone().register_metrics(slow_store_registry);
}
}
1 change: 1 addition & 0 deletions gencargo/fast_slow_store/Cargo.toml
Expand Up @@ -28,3 +28,4 @@ config = { workspace = true }
buf_channel = { workspace = true }
common = { workspace = true }
error = { workspace = true }
metrics_utils = { workspace = true }

0 comments on commit 10d2618

Please sign in to comment.