diff options
| author | Per Larsson <[email protected]> | 2021-10-01 14:45:59 +0200 |
|---|---|---|
| committer | Per Larsson <[email protected]> | 2021-10-01 14:45:59 +0200 |
| commit | be6e8143f2ea0c4acc87608f651058627b2c229c (patch) | |
| tree | f567ae8b608e7ed55b56b5deff42373349310ed2 /zenserver/upstream/upstreamcache.cpp | |
| parent | Improved error handling for upstream endpoints. (diff) | |
| download | zen-be6e8143f2ea0c4acc87608f651058627b2c229c.tar.xz zen-be6e8143f2ea0c4acc87608f651058627b2c229c.zip | |
Added cache HIT/MISS stat counters.
Diffstat (limited to 'zenserver/upstream/upstreamcache.cpp')
| -rw-r--r-- | zenserver/upstream/upstreamcache.cpp | 14 |
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); } |