aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcache.h
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-10-01 22:15:42 +0200
committerStefan Boberg <[email protected]>2021-10-01 22:15:42 +0200
commit2a6157b15508541cfd082e8544c78c8f94b18005 (patch)
tree7f70bd046afe918c5433e753a68de72ed602532a /zenserver/cache/structuredcache.h
parentAdded explicit mimalloc IoBuffer allocation path (diff)
parentzen: added print/printpackage subcommands to help in debugging or inspecting ... (diff)
downloadzen-2a6157b15508541cfd082e8544c78c8f94b18005.tar.xz
zen-2a6157b15508541cfd082e8544c78c8f94b18005.zip
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zenserver/cache/structuredcache.h')
-rw-r--r--zenserver/cache/structuredcache.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/zenserver/cache/structuredcache.h b/zenserver/cache/structuredcache.h
index 47fc173e9..a360878bd 100644
--- a/zenserver/cache/structuredcache.h
+++ b/zenserver/cache/structuredcache.h
@@ -71,6 +71,13 @@ private:
IoHash PayloadId;
};
+ struct CacheStats
+ {
+ std::atomic_uint64_t HitCount{};
+ std::atomic_uint64_t UpstreamHitCount{};
+ std::atomic_uint64_t MissCount{};
+ };
+
[[nodiscard]] bool ValidateKeyUri(zen::HttpServerRequest& Request, CacheRef& OutRef);
void HandleCacheRecordRequest(zen::HttpServerRequest& Request, const CacheRef& Ref, CachePolicy Policy);
void HandleGetCacheRecord(zen::HttpServerRequest& Request, const CacheRef& Ref, CachePolicy Policy);
@@ -89,6 +96,7 @@ private:
std::unique_ptr<UpstreamCache> m_UpstreamCache;
uint64_t m_LastScrubTime = 0;
metrics::OperationTiming m_HttpRequests;
+ CacheStats m_CacheStats;
};
} // namespace zen