Skip to content

Commit

Permalink
Update lib.rs
Browse files Browse the repository at this point in the history
Signed-off-by: KhulnaSoft bot <[email protected]>
  • Loading branch information
khulnasoft-bot authored Dec 18, 2024
1 parent 44502e4 commit f1b17e0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bongonet-cache/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,19 @@ impl HttpCache {
inner.traces.enable(parent_span);
}
}

// Get the cache parent tracing span
pub fn get_cache_span(&self) -> Option<trace::SpanHandle> {
self.inner.as_ref().map(|i| i.traces.get_cache_span())
}

// Get the cache `miss` tracing span
pub fn get_miss_span(&mut self) -> Option<trace::SpanHandle> {
self.inner.as_mut().map(|i| i.traces.get_miss_span())
pub fn get_miss_span(&self) -> Option<trace::SpanHandle> {
self.inner.as_ref().map(|i| i.traces.get_miss_span())
}
// Get the cache `hit` tracing span
pub fn get_hit_span(&self) -> Option<trace::SpanHandle> {
self.inner.as_ref().map(|i| i.traces.get_hit_span())
}

// shortcut to access inner, panic if phase is disabled
Expand Down

0 comments on commit f1b17e0

Please sign in to comment.