diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/messagebus/remote_connection_status.h | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/messagebus/remote_connection_status.h')
-rw-r--r-- | library/cpp/messagebus/remote_connection_status.h | 302 |
1 files changed, 151 insertions, 151 deletions
diff --git a/library/cpp/messagebus/remote_connection_status.h b/library/cpp/messagebus/remote_connection_status.h index f98f1ff8e9..5db10e51ea 100644 --- a/library/cpp/messagebus/remote_connection_status.h +++ b/library/cpp/messagebus/remote_connection_status.h @@ -15,200 +15,200 @@ namespace NBus { class TConnectionStatusMonRecord; } -namespace NBus { - namespace NPrivate { +namespace NBus { + namespace NPrivate { #define WRITER_STATE_MAP(XX) \ - XX(WRITER_UNKNOWN) \ - XX(WRITER_FILLING) \ - XX(WRITER_FLUSHING) \ + XX(WRITER_UNKNOWN) \ + XX(WRITER_FILLING) \ + XX(WRITER_FLUSHING) \ /**/ - // TODO: move elsewhere - enum EWriterState { - WRITER_STATE_MAP(ENUM_VALUE_GEN_NO_VALUE) - }; + // TODO: move elsewhere + enum EWriterState { + WRITER_STATE_MAP(ENUM_VALUE_GEN_NO_VALUE) + }; - ENUM_TO_STRING(EWriterState, WRITER_STATE_MAP) + ENUM_TO_STRING(EWriterState, WRITER_STATE_MAP) #define STRUCT_FIELD_ADD(name, type, func) func(name, that.name); - template <typename T> - void Reset(T& t) { - t.~T(); - new (&t) T(); - } + template <typename T> + void Reset(T& t) { + t.~T(); + new (&t) T(); + } -#define DURATION_COUNTER_MAP(XX, comma) \ - XX(Count, unsigned, Add) \ - comma \ - XX(SumDuration, TDuration, Add) comma \ - XX(MaxDuration, TDuration, Max) /**/ +#define DURATION_COUNTER_MAP(XX, comma) \ + XX(Count, unsigned, Add) \ + comma \ + XX(SumDuration, TDuration, Add) comma \ + XX(MaxDuration, TDuration, Max) /**/ - struct TDurationCounter { - DURATION_COUNTER_MAP(STRUCT_FIELD_GEN, ) + struct TDurationCounter { + DURATION_COUNTER_MAP(STRUCT_FIELD_GEN, ) - TDuration AvgDuration() const; + TDuration AvgDuration() const; - TDurationCounter(); + TDurationCounter(); - void AddDuration(TDuration d) { - Count += 1; - SumDuration += d; - if (d > MaxDuration) { - MaxDuration = d; - } - } + void AddDuration(TDuration d) { + Count += 1; + SumDuration += d; + if (d > MaxDuration) { + MaxDuration = d; + } + } - TDurationCounter& operator+=(const TDurationCounter&); + TDurationCounter& operator+=(const TDurationCounter&); - TString ToString() const; - }; + TString ToString() const; + }; #define REMOTE_CONNECTION_STATUS_BASE_MAP(XX, comma) \ - XX(ConnectionId, ui64, AssertZero) \ - comma \ - XX(Fd, SOCKET, AssertZero) comma \ - XX(Acts, ui64, Add) comma \ - XX(BufferSize, ui64, Add) /**/ + XX(ConnectionId, ui64, AssertZero) \ + comma \ + XX(Fd, SOCKET, AssertZero) comma \ + XX(Acts, ui64, Add) comma \ + XX(BufferSize, ui64, Add) /**/ - struct TRemoteConnectionStatusBase { - REMOTE_CONNECTION_STATUS_BASE_MAP(STRUCT_FIELD_GEN, ) + struct TRemoteConnectionStatusBase { + REMOTE_CONNECTION_STATUS_BASE_MAP(STRUCT_FIELD_GEN, ) - TRemoteConnectionStatusBase& operator+=(const TRemoteConnectionStatusBase&); + TRemoteConnectionStatusBase& operator+=(const TRemoteConnectionStatusBase&); - TRemoteConnectionStatusBase(); - }; + TRemoteConnectionStatusBase(); + }; #define REMOTE_CONNECTION_INCREMENTAL_STATUS_BASE_MAP(XX, comma) \ - XX(BufferDrops, unsigned, Add) \ - comma \ - XX(NetworkOps, unsigned, Add) /**/ + XX(BufferDrops, unsigned, Add) \ + comma \ + XX(NetworkOps, unsigned, Add) /**/ - struct TRemoteConnectionIncrementalStatusBase { - REMOTE_CONNECTION_INCREMENTAL_STATUS_BASE_MAP(STRUCT_FIELD_GEN, ) + struct TRemoteConnectionIncrementalStatusBase { + REMOTE_CONNECTION_INCREMENTAL_STATUS_BASE_MAP(STRUCT_FIELD_GEN, ) - TRemoteConnectionIncrementalStatusBase& operator+=(const TRemoteConnectionIncrementalStatusBase&); + TRemoteConnectionIncrementalStatusBase& operator+=(const TRemoteConnectionIncrementalStatusBase&); - TRemoteConnectionIncrementalStatusBase(); - }; + TRemoteConnectionIncrementalStatusBase(); + }; #define REMOTE_CONNECTION_READER_INCREMENTAL_STATUS_MAP(XX, comma) \ - XX(MessageCounter, TMessageCounter, Add) \ - comma \ - XX(StatusCounter, TMessageStatusCounter, Add) /**/ + XX(MessageCounter, TMessageCounter, Add) \ + comma \ + XX(StatusCounter, TMessageStatusCounter, Add) /**/ - struct TRemoteConnectionReaderIncrementalStatus: public TRemoteConnectionIncrementalStatusBase { - REMOTE_CONNECTION_READER_INCREMENTAL_STATUS_MAP(STRUCT_FIELD_GEN, ) + struct TRemoteConnectionReaderIncrementalStatus: public TRemoteConnectionIncrementalStatusBase { + REMOTE_CONNECTION_READER_INCREMENTAL_STATUS_MAP(STRUCT_FIELD_GEN, ) - TRemoteConnectionReaderIncrementalStatus& operator+=(const TRemoteConnectionReaderIncrementalStatus&); + TRemoteConnectionReaderIncrementalStatus& operator+=(const TRemoteConnectionReaderIncrementalStatus&); - TRemoteConnectionReaderIncrementalStatus(); - }; + TRemoteConnectionReaderIncrementalStatus(); + }; #define REMOTE_CONNECTION_READER_STATUS_MAP(XX, comma) \ - XX(QuotaMsg, size_t, Add) \ - comma \ - XX(QuotaBytes, size_t, Add) comma \ - XX(QuotaExhausted, size_t, Add) comma \ - XX(Incremental, TRemoteConnectionReaderIncrementalStatus, Add) /**/ + XX(QuotaMsg, size_t, Add) \ + comma \ + XX(QuotaBytes, size_t, Add) comma \ + XX(QuotaExhausted, size_t, Add) comma \ + XX(Incremental, TRemoteConnectionReaderIncrementalStatus, Add) /**/ - struct TRemoteConnectionReaderStatus: public TRemoteConnectionStatusBase { - REMOTE_CONNECTION_READER_STATUS_MAP(STRUCT_FIELD_GEN, ) + struct TRemoteConnectionReaderStatus: public TRemoteConnectionStatusBase { + REMOTE_CONNECTION_READER_STATUS_MAP(STRUCT_FIELD_GEN, ) - TRemoteConnectionReaderStatus& operator+=(const TRemoteConnectionReaderStatus&); + TRemoteConnectionReaderStatus& operator+=(const TRemoteConnectionReaderStatus&); - TRemoteConnectionReaderStatus(); - }; + TRemoteConnectionReaderStatus(); + }; #define REMOTE_CONNECTION_WRITER_INCREMENTAL_STATUS(XX, comma) \ - XX(MessageCounter, TMessageCounter, Add) \ - comma \ - XX(StatusCounter, TMessageStatusCounter, Add) comma \ - XX(ProcessDurationHistogram, TDurationHistogram, Add) /**/ + XX(MessageCounter, TMessageCounter, Add) \ + comma \ + XX(StatusCounter, TMessageStatusCounter, Add) comma \ + XX(ProcessDurationHistogram, TDurationHistogram, Add) /**/ - struct TRemoteConnectionWriterIncrementalStatus: public TRemoteConnectionIncrementalStatusBase { - REMOTE_CONNECTION_WRITER_INCREMENTAL_STATUS(STRUCT_FIELD_GEN, ) + struct TRemoteConnectionWriterIncrementalStatus: public TRemoteConnectionIncrementalStatusBase { + REMOTE_CONNECTION_WRITER_INCREMENTAL_STATUS(STRUCT_FIELD_GEN, ) - TRemoteConnectionWriterIncrementalStatus& operator+=(const TRemoteConnectionWriterIncrementalStatus&); + TRemoteConnectionWriterIncrementalStatus& operator+=(const TRemoteConnectionWriterIncrementalStatus&); - TRemoteConnectionWriterIncrementalStatus(); - }; + TRemoteConnectionWriterIncrementalStatus(); + }; -#define REMOTE_CONNECTION_WRITER_STATUS(XX, comma) \ - XX(Connected, bool, AssertZero) \ - comma \ - XX(ConnectTime, TInstant, AssertZero) comma /* either connect time on client or accept time on server */ \ - XX(ConnectError, int, AssertZero) comma \ - XX(ConnectSyscalls, unsigned, Add) comma \ - XX(PeerAddr, TNetAddr, AssertZero) comma \ - XX(MyAddr, TNetAddr, AssertZero) comma \ - XX(State, EWriterState, AssertZero) comma \ - XX(SendQueueSize, size_t, Add) comma \ - XX(AckMessagesSize, size_t, Add) comma /* client only */ \ - XX(DurationCounter, TDurationCounter, Add) comma /* server only */ \ - XX(DurationCounterPrev, TDurationCounter, Add) comma /* server only */ \ - XX(Incremental, TRemoteConnectionWriterIncrementalStatus, Add) comma \ - XX(ReaderWakeups, size_t, Add) /**/ +#define REMOTE_CONNECTION_WRITER_STATUS(XX, comma) \ + XX(Connected, bool, AssertZero) \ + comma \ + XX(ConnectTime, TInstant, AssertZero) comma /* either connect time on client or accept time on server */ \ + XX(ConnectError, int, AssertZero) comma \ + XX(ConnectSyscalls, unsigned, Add) comma \ + XX(PeerAddr, TNetAddr, AssertZero) comma \ + XX(MyAddr, TNetAddr, AssertZero) comma \ + XX(State, EWriterState, AssertZero) comma \ + XX(SendQueueSize, size_t, Add) comma \ + XX(AckMessagesSize, size_t, Add) comma /* client only */ \ + XX(DurationCounter, TDurationCounter, Add) comma /* server only */ \ + XX(DurationCounterPrev, TDurationCounter, Add) comma /* server only */ \ + XX(Incremental, TRemoteConnectionWriterIncrementalStatus, Add) comma \ + XX(ReaderWakeups, size_t, Add) /**/ - struct TRemoteConnectionWriterStatus: public TRemoteConnectionStatusBase { - REMOTE_CONNECTION_WRITER_STATUS(STRUCT_FIELD_GEN, ) + struct TRemoteConnectionWriterStatus: public TRemoteConnectionStatusBase { + REMOTE_CONNECTION_WRITER_STATUS(STRUCT_FIELD_GEN, ) - TRemoteConnectionWriterStatus(); + TRemoteConnectionWriterStatus(); - TRemoteConnectionWriterStatus& operator+=(const TRemoteConnectionWriterStatus&); + TRemoteConnectionWriterStatus& operator+=(const TRemoteConnectionWriterStatus&); - size_t GetInFlight() const; - }; + size_t GetInFlight() const; + }; #define REMOTE_CONNECTION_STATUS_MAP(XX, comma) \ - XX(Summary, bool) \ - comma \ - XX(Server, bool) /**/ - - struct TRemoteConnectionStatus { - REMOTE_CONNECTION_STATUS_MAP(STRUCT_FIELD_GEN, ) - - TRemoteConnectionReaderStatus ReaderStatus; - TRemoteConnectionWriterStatus WriterStatus; - - TRemoteConnectionStatus(); - - TString PrintToString() const; - TConnectionStatusMonRecord GetStatusProtobuf() const; - }; - - struct TBusSessionStatus { - size_t InFlightCount; - size_t InFlightSize; - bool InputPaused; - - TBusSessionStatus(); - }; - - struct TSessionDumpStatus { - bool Shutdown; - TString Head; - TString Acceptors; - TString ConnectionsSummary; - TString Connections; - TBusSessionStatus Status; - TRemoteConnectionStatus ConnectionStatusSummary; - TBusSessionConfig Config; - - TSessionDumpStatus() - : Shutdown(false) - { - } - - TString PrintToString() const; - }; - - // without sessions - struct TBusMessageQueueStatus { - NActor::NPrivate::TExecutorStatus ExecutorStatus; - TBusQueueConfig Config; - - TString PrintToString() const; - }; - } -} + XX(Summary, bool) \ + comma \ + XX(Server, bool) /**/ + + struct TRemoteConnectionStatus { + REMOTE_CONNECTION_STATUS_MAP(STRUCT_FIELD_GEN, ) + + TRemoteConnectionReaderStatus ReaderStatus; + TRemoteConnectionWriterStatus WriterStatus; + + TRemoteConnectionStatus(); + + TString PrintToString() const; + TConnectionStatusMonRecord GetStatusProtobuf() const; + }; + + struct TBusSessionStatus { + size_t InFlightCount; + size_t InFlightSize; + bool InputPaused; + + TBusSessionStatus(); + }; + + struct TSessionDumpStatus { + bool Shutdown; + TString Head; + TString Acceptors; + TString ConnectionsSummary; + TString Connections; + TBusSessionStatus Status; + TRemoteConnectionStatus ConnectionStatusSummary; + TBusSessionConfig Config; + + TSessionDumpStatus() + : Shutdown(false) + { + } + + TString PrintToString() const; + }; + + // without sessions + struct TBusMessageQueueStatus { + NActor::NPrivate::TExecutorStatus ExecutorStatus; + TBusQueueConfig Config; + + TString PrintToString() const; + }; + } +} |