aboutsummaryrefslogtreecommitdiffhomepage
path: root/pingora-cache/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'pingora-cache/src/lib.rs')
-rw-r--r--pingora-cache/src/lib.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/pingora-cache/src/lib.rs b/pingora-cache/src/lib.rs
index f747672..bc370b7 100644
--- a/pingora-cache/src/lib.rs
+++ b/pingora-cache/src/lib.rs
@@ -457,9 +457,19 @@ impl HttpCache {
}
}
+ // 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