Skip to content

Commit

Permalink
expose getters for cache and hit spans
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 9e2a7db commit 44502e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bongonet-cache/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ impl CacheTraceCTX {
pub fn enable(&mut self, cache_span: Span) {
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 {
Expand All @@ -70,6 +73,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);
}
Expand Down

0 comments on commit 44502e4

Please sign in to comment.