diff options
| author | Stefan Boberg <[email protected]> | 2021-09-30 14:45:07 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-30 14:45:07 +0200 |
| commit | 56ac15aa5d44a7564497fc4e7f252d135a1904a4 (patch) | |
| tree | b7e1e1d8afdf93c19c79cfbd0b586178f5cc0f02 /zenserver/cache/structuredcache.cpp | |
| parent | metrics: added OperationTiming which is a useful combination of a Meter and a... (diff) | |
| download | zen-56ac15aa5d44a7564497fc4e7f252d135a1904a4.tar.xz zen-56ac15aa5d44a7564497fc4e7f252d135a1904a4.zip | |
structured cache: Rewrote metrics tracking using OperationTiming
Diffstat (limited to 'zenserver/cache/structuredcache.cpp')
| -rw-r--r-- | zenserver/cache/structuredcache.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/zenserver/cache/structuredcache.cpp b/zenserver/cache/structuredcache.cpp index c3b60ea8d..c71beb700 100644 --- a/zenserver/cache/structuredcache.cpp +++ b/zenserver/cache/structuredcache.cpp @@ -194,10 +194,7 @@ HttpStructuredCacheService::HandleRequest(HttpServerRequest& Request) { CacheRef Ref; - m_HttpRequestMeter.Mark(1); - - Stopwatch Timer; - auto _ = MakeGuard([&] { m_HttpRequests.Update(Timer.GetElapsedTicks()); }); + metrics::OperationTiming::Scope $(m_HttpRequests); if (!ValidateKeyUri(Request, /* out */ Ref)) { @@ -846,9 +843,8 @@ HttpStructuredCacheService::HandleStatusRequest(zen::HttpServerRequest& Request) { CbObjectWriter Cbo; Cbo << "ok" << true; - + EmitSnapshot("requests", m_HttpRequests, Cbo); - EmitSnapshot("request_rate", m_HttpRequestMeter, Cbo); Request.WriteResponse(HttpResponseCode::OK, Cbo.Save()); } |