aboutsummaryrefslogtreecommitdiffhomepage
path: root/pingora-cache/src/trace.rs
diff options
context:
space:
mode:
authorMatthew Gumport <[email protected]>2024-11-19 14:03:04 -0800
committerYuchen Wu <[email protected]>2024-12-13 16:25:44 -0800
commit3f0f68b0ec75ccf181c86786ea17f644bbdfafd2 (patch)
tree9cc2c73c3488d0198f5cae3524ca15f445f4c9a5 /pingora-cache/src/trace.rs
parentdcb40b620eb49dd9482d108dbf6751048a3859ad (diff)
downloadpingora-bleeper-yuchen-fc39bb0c3d35fa5e07c21c261c2a5a68af53d440.tar.gz
pingora-bleeper-yuchen-fc39bb0c3d35fa5e07c21c261c2a5a68af53d440.zip
expose getters for cache and hit spansbleeper-yuchen-fc39bb0c3d35fa5e07c21c261c2a5a68af53d440
Diffstat (limited to 'pingora-cache/src/trace.rs')
-rw-r--r--pingora-cache/src/trace.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/pingora-cache/src/trace.rs b/pingora-cache/src/trace.rs
index 58f3511..e48ae6f 100644
--- a/pingora-cache/src/trace.rs
+++ b/pingora-cache/src/trace.rs
@@ -46,6 +46,10 @@ impl CacheTraceCTX {
self.cache_span = cache_span;
}
+ pub fn get_cache_span(&self) -> SpanHandle {
+ self.cache_span.handle()
+ }
+
#[inline]
pub fn child(&self, name: &'static str) -> Span {
self.cache_span.child(name, |o| o.start())
@@ -70,6 +74,10 @@ impl CacheTraceCTX {
.set_tag(|| Tag::new("status", hit_status.as_str()));
}
+ pub fn get_hit_span(&self) -> SpanHandle {
+ self.hit_span.handle()
+ }
+
pub fn finish_hit_span(&mut self) {
self.hit_span.set_finish_time(SystemTime::now);
}