mirror of
https://github.com/cloudflare/pingora.git
synced 2024-09-20 02:31:35 +02:00
Allow the lookup_duration to be read
This commit is contained in:
parent
382cf87141
commit
393ff19162
2 changed files with 8 additions and 2 deletions
2
.bleep
2
.bleep
|
@ -1 +1 @@
|
|||
ce62ef5259bbe34107ad85f6f5557cda0d53764f
|
||||
1819510ea4b2b82f5fbf71bae17479f0287b7824
|
|
@ -222,7 +222,7 @@ struct HttpCacheInner {
|
|||
pub lock: Option<Locked>, // TODO: these 3 fields should come in 1 sub struct
|
||||
pub cache_lock: Option<&'static CacheLock>,
|
||||
pub lock_duration: Option<Duration>,
|
||||
/// time spent in cache lookup and reading the header
|
||||
// time spent in cache lookup and reading the header
|
||||
pub lookup_duration: Option<Duration>,
|
||||
pub traces: trace::CacheTraceCTX,
|
||||
}
|
||||
|
@ -1048,6 +1048,12 @@ impl HttpCache {
|
|||
self.inner.as_ref().and_then(|i| i.lock_duration)
|
||||
}
|
||||
|
||||
/// How long did this request spent on cache lookup and reading the header
|
||||
pub fn lookup_duration(&self) -> Option<Duration> {
|
||||
// FIXME: this duration is lost when cache is disabled
|
||||
self.inner.as_ref().and_then(|i| i.lookup_duration)
|
||||
}
|
||||
|
||||
/// Delete the asset from the cache storage
|
||||
/// # Panic
|
||||
/// Need to be called after the cache key is set. Panic otherwise.
|
||||
|
|
Loading…
Reference in a new issue