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 | |
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')
-rw-r--r-- | library/cpp/grpc/server/grpc_counters.h | 36 | ||||
-rw-r--r-- | library/cpp/grpc/server/grpc_request.h | 4 | ||||
-rw-r--r-- | library/cpp/grpc/server/grpc_server.cpp | 20 | ||||
-rw-r--r-- | library/cpp/grpc/server/grpc_server.h | 16 |
4 files changed, 38 insertions, 38 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>; diff --git a/library/cpp/grpc/server/grpc_request.h b/library/cpp/grpc/server/grpc_request.h index 1cad232d9d..5bd8d3902b 100644 --- a/library/cpp/grpc/server/grpc_request.h +++ b/library/cpp/grpc/server/grpc_request.h @@ -367,7 +367,7 @@ private: // Adjust counters. RequestSize = Request_->ByteSize(); Counters_->StartProcessing(RequestSize); - RequestTimer.Reset(); + RequestTimer.Reset(); if (!SslServer()) { Counters_->CountRequestWithoutTls(); @@ -499,7 +499,7 @@ private: ui32 RequestSize = 0; ui32 ResponseSize = 0; ui32 ResponseStatus = 0; - THPTimer RequestTimer; + THPTimer RequestTimer; TAuthState AuthState_ = 0; bool RequestRegistered_ = false; diff --git a/library/cpp/grpc/server/grpc_server.cpp b/library/cpp/grpc/server/grpc_server.cpp index 10ace01eb5..7437b7a8f5 100644 --- a/library/cpp/grpc/server/grpc_server.cpp +++ b/library/cpp/grpc/server/grpc_server.cpp @@ -5,16 +5,16 @@ #include <util/system/thread.h> #include <grpc++/resource_quota.h> -#include <contrib/libs/grpc/src/core/lib/iomgr/socket_mutator.h> - -#if !defined(_WIN32) && !defined(_WIN64) - -#include <sys/socket.h> -#include <netinet/in.h> -#include <netinet/tcp.h> - -#endif - +#include <contrib/libs/grpc/src/core/lib/iomgr/socket_mutator.h> + +#if !defined(_WIN32) && !defined(_WIN64) + +#include <sys/socket.h> +#include <netinet/in.h> +#include <netinet/tcp.h> + +#endif + namespace NGrpc { using NThreading::TFuture; diff --git a/library/cpp/grpc/server/grpc_server.h b/library/cpp/grpc/server/grpc_server.h index 5973d1de28..d6814a90a0 100644 --- a/library/cpp/grpc/server/grpc_server.h +++ b/library/cpp/grpc/server/grpc_server.h @@ -8,7 +8,7 @@ #include <util/generic/ptr.h> #include <util/generic/string.h> #include <util/generic/vector.h> -#include <util/generic/maybe.h> +#include <util/generic/maybe.h> #include <util/generic/queue.h> #include <util/generic/hash_set.h> #include <util/system/types.h> @@ -67,16 +67,16 @@ struct TServerOptions { //! Use GRpc keepalive DECLARE_FIELD(KeepAliveEnable, TMaybe<bool>, TMaybe<bool>()); - + //! GRPC_ARG_KEEPALIVE_TIME_MS setting - DECLARE_FIELD(KeepAliveIdleTimeoutTriggerSec, int, 0); - + DECLARE_FIELD(KeepAliveIdleTimeoutTriggerSec, int, 0); + //! Deprecated, ths option ignored. Will be removed soon. - DECLARE_FIELD(KeepAliveMaxProbeCount, int, 0); - + DECLARE_FIELD(KeepAliveMaxProbeCount, int, 0); + //! GRPC_ARG_KEEPALIVE_TIMEOUT_MS setting - DECLARE_FIELD(KeepAliveProbeIntervalSec, int, 0); - + DECLARE_FIELD(KeepAliveProbeIntervalSec, int, 0); + //! Max number of requests processing by services (global limit for grpc server) DECLARE_FIELD(MaxGlobalRequestInFlight, size_t, 100000); |