aboutsummaryrefslogtreecommitdiff
path: root/zenserver/upstream/upstreamcache.cpp
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/upstream/upstreamcache.cpp
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/upstream/upstreamcache.cpp')
-rw-r--r--zenserver/upstream/upstreamcache.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/zenserver/upstream/upstreamcache.cpp b/zenserver/upstream/upstreamcache.cpp
index 58a5b1ff3..b1966e299 100644
--- a/zenserver/upstream/upstreamcache.cpp
+++ b/zenserver/upstream/upstreamcache.cpp
@@ -612,11 +612,6 @@ struct UpstreamStats
const GetUpstreamCacheResult& Result,
const std::vector<std::unique_ptr<UpstreamEndpoint>>& Endpoints)
{
- if (!m_Enabled)
- {
- return;
- }
-
UpstreamEndpointStats& Stats = Endpoint.Stats();
if (Result.Error)
@@ -634,7 +629,7 @@ struct UpstreamStats
Stats.MissCount++;
}
- if (m_SampleCount++ % MaxSampleCount)
+ if (m_Enabled && m_SampleCount++ % MaxSampleCount)
{
Dump(Logger, Endpoints);
}
@@ -645,11 +640,6 @@ struct UpstreamStats
const PutUpstreamCacheResult& Result,
const std::vector<std::unique_ptr<UpstreamEndpoint>>& Endpoints)
{
- if (!m_Enabled)
- {
- return;
- }
-
UpstreamEndpointStats& Stats = Endpoint.Stats();
if (Result.Success)
{
@@ -662,7 +652,7 @@ struct UpstreamStats
Stats.ErrorCount++;
}
- if (m_SampleCount++ % MaxSampleCount)
+ if (m_Enabled && m_SampleCount++ % MaxSampleCount)
{
Dump(Logger, Endpoints);
}