diff options
author | Alexander Rutkovsky <alexvru@mail.ru> | 2022-02-10 16:47:40 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:40 +0300 |
commit | 667a4ee7da2e004784b9c3cfab824a81e96f4d66 (patch) | |
tree | c0748b5dcbade83af788c0abfa89c0383d6b779c /library/cpp/grpc/server/grpc_counters.h | |
parent | f3646f91e0de459836a7800b9ce3e8dc57a2ab3a (diff) | |
download | ydb-667a4ee7da2e004784b9c3cfab824a81e96f4d66.tar.gz |
Restoring authorship annotation for Alexander Rutkovsky <alexvru@mail.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/grpc/server/grpc_counters.h')
-rw-r--r-- | library/cpp/grpc/server/grpc_counters.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/library/cpp/grpc/server/grpc_counters.h b/library/cpp/grpc/server/grpc_counters.h index 9d2d53cf7e..0b6c36c84c 100644 --- a/library/cpp/grpc/server/grpc_counters.h +++ b/library/cpp/grpc/server/grpc_counters.h @@ -35,7 +35,7 @@ class TCounterBlock final : public ICounterBlock { NMonitoring::TDynamicCounters::TCounterPtr ResponseBytes; NMonitoring::TDynamicCounters::TCounterPtr NotAuthenticated; NMonitoring::TDynamicCounters::TCounterPtr ResourceExhausted; - bool Percentile = false; + bool Percentile = false; NMonitoring::TPercentileTracker<4, 512, 15> RequestHistMs; std::array<NMonitoring::TDynamicCounters::TCounterPtr, 2> GRpcStatusCounters; @@ -46,10 +46,10 @@ public: NMonitoring::TDynamicCounters::TCounterPtr notOkResponseCounter, NMonitoring::TDynamicCounters::TCounterPtr requestBytes, NMonitoring::TDynamicCounters::TCounterPtr inflyRequestBytes, - NMonitoring::TDynamicCounters::TCounterPtr responseBytes, + NMonitoring::TDynamicCounters::TCounterPtr responseBytes, NMonitoring::TDynamicCounters::TCounterPtr notAuthenticated, NMonitoring::TDynamicCounters::TCounterPtr resourceExhausted, - TIntrusivePtr<NMonitoring::TDynamicCounters> group) + TIntrusivePtr<NMonitoring::TDynamicCounters> group) : TotalCounter(std::move(totalCounter)) , InflyCounter(std::move(inflyCounter)) , NotOkRequestCounter(std::move(notOkRequestCounter)) @@ -59,12 +59,12 @@ public: , ResponseBytes(std::move(responseBytes)) , NotAuthenticated(std::move(notAuthenticated)) , ResourceExhausted(std::move(resourceExhausted)) - { - if (group) { - RequestHistMs.Initialize(group, "event", "request", "ms", {0.5f, 0.9f, 0.99f, 0.999f, 1.0f}); - Percentile = true; - } - } + { + if (group) { + RequestHistMs.Initialize(group, "event", "request", "ms", {0.5f, 0.9f, 0.99f, 0.999f, 1.0f}); + Percentile = true; + } + } void CountNotOkRequest() override { NotOkRequestCounter->Inc(); @@ -108,20 +108,20 @@ public: if (!ok) { NotOkResponseCounter->Inc(); } - if (Percentile) { - RequestHistMs.Increment(requestDuration.MilliSeconds()); - } + if (Percentile) { + RequestHistMs.Increment(requestDuration.MilliSeconds()); + } } - + ICounterBlockPtr Clone() override { return this; } - void Update() { - if (Percentile) { - RequestHistMs.Update(); - } - } + void Update() { + if (Percentile) { + RequestHistMs.Update(); + } + } }; using TCounterBlockPtr = TIntrusivePtr<TCounterBlock>; |