aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/grpc/server
diff options
context:
space:
mode:
authorAlexander Rutkovsky <alexvru@mail.ru>2022-02-10 16:47:39 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:39 +0300
commitf3646f91e0de459836a7800b9ce3e8dc57a2ab3a (patch)
tree25c1423200152570c1f8307e5b8304b9bc3840c5 /library/cpp/grpc/server
parentfccc62e9bfdce9be2fe7e0f23479da3a5512211a (diff)
downloadydb-f3646f91e0de459836a7800b9ce3e8dc57a2ab3a.tar.gz
Restoring authorship annotation for Alexander Rutkovsky <alexvru@mail.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/grpc/server')
-rw-r--r--library/cpp/grpc/server/grpc_counters.h36
-rw-r--r--library/cpp/grpc/server/grpc_request.h4
-rw-r--r--library/cpp/grpc/server/grpc_server.cpp20
-rw-r--r--library/cpp/grpc/server/grpc_server.h16
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 0b6c36c84c..9d2d53cf7e 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 5bd8d3902b..1cad232d9d 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 7437b7a8f5..10ace01eb5 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 d6814a90a0..5973d1de28 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);