aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcache.h
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-10-01 18:52:36 +0200
committerStefan Boberg <[email protected]>2021-10-01 18:52:36 +0200
commit00a2b35cf24a8bc9f87602506236437d71be41d4 (patch)
tree9f3e5863eaa3d50a7d741fc707f4e99d4397eac7 /zenserver/cache/structuredcache.h
parentAdded some code to persist bad package data for inspection (diff)
parentAdded simple stats HTML dashboard with route /dashboard. (diff)
downloadzen-00a2b35cf24a8bc9f87602506236437d71be41d4.tar.xz
zen-00a2b35cf24a8bc9f87602506236437d71be41d4.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