aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/cache/httpstructuredcache.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2023-10-06 10:27:47 +0200
committerGitHub <[email protected]>2023-10-06 10:27:47 +0200
commit3a09799e45e3460cdd9a54a73e9932f58eb50e56 (patch)
tree0e3734f14eab988b99f9ed3dcb6861022c442935 /src/zenserver/cache/httpstructuredcache.cpp
parent0.2.26 (diff)
downloadzen-3a09799e45e3460cdd9a54a73e9932f58eb50e56.tar.xz
zen-3a09799e45e3460cdd9a54a73e9932f58eb50e56.zip
reject known bad bucket names in structured cache (#452)v0.2.27-pre0
* added string_view helpers for ParseHexBytes/ParseHexNumber * reject known bad buckets in structured cache put handler (32-character hex bucket names are rejected) * also added bucket rejection logic to bucket discovery * added rejected_writes stat to HttpStructuredCache
Diffstat (limited to 'src/zenserver/cache/httpstructuredcache.cpp')
-rw-r--r--src/zenserver/cache/httpstructuredcache.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/zenserver/cache/httpstructuredcache.cpp b/src/zenserver/cache/httpstructuredcache.cpp
index 4a3f5f269..d499ccd9f 100644
--- a/src/zenserver/cache/httpstructuredcache.cpp
+++ b/src/zenserver/cache/httpstructuredcache.cpp
@@ -3299,7 +3299,8 @@ HttpStructuredCacheService::HandleStatsRequest(HttpServerRequest& Request)
if (ShowCacheStoreStats)
{
Cbo.BeginObject("store");
- Cbo << "hits" << CacheStoreStats.HitCount << "misses" << CacheStoreStats.MissCount << "writes" << CacheStoreStats.WriteCount;
+ Cbo << "hits" << CacheStoreStats.HitCount << "misses" << CacheStoreStats.MissCount << "writes" << CacheStoreStats.WriteCount
+ << "rejected_writes" << CacheStoreStats.RejectedWriteCount;
const uint64_t StoreTotal = CacheStoreStats.HitCount + CacheStoreStats.MissCount;
Cbo << "hit_ratio" << (StoreTotal > 0 ? (double(CacheStoreStats.HitCount) / double(StoreTotal)) : 0.0);
EmitSnapshot("read", CacheStoreStats.GetOps, Cbo);