counters.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #include "counters.h"
  2. using namespace NMonitoring;
  3. namespace NUnifiedAgent {
  4. TClientCounters::TClientCounters(const NMonitoring::TDynamicCounterPtr& counters)
  5. : TDynamicCountersWrapper(counters)
  6. , ActiveSessionsCount(GetCounter("ActiveSessionsCount", false))
  7. , ClientLogDroppedBytes(GetCounter("ClientLogDroppedBytes", true))
  8. {
  9. }
  10. TIntrusivePtr<TClientSessionCounters> TClientCounters::GetDefaultSessionCounters() {
  11. auto group = Unwrap()->GetSubgroup("session", "default");
  12. return MakeIntrusive<TClientSessionCounters>(group);
  13. }
  14. TClientSessionCounters::TClientSessionCounters(const NMonitoring::TDynamicCounterPtr& counters)
  15. : TDynamicCountersWrapper(counters)
  16. , ReceivedMessages(GetCounter("ReceivedMessages", true))
  17. , ReceivedBytes(GetCounter("ReceivedBytes", true))
  18. , AcknowledgedMessages(GetCounter("AcknowledgedMessages", true))
  19. , AcknowledgedBytes(GetCounter("AcknowledgedBytes", true))
  20. , InflightMessages(GetCounter("InflightMessages", false))
  21. , InflightBytes(GetCounter("InflightBytes", false))
  22. , GrpcWriteBatchRequests(GetCounter("GrpcWriteBatchRequests", true))
  23. , GrpcInflightMessages(GetCounter("GrpcInflightMessages", false))
  24. , GrpcInflightBytes(GetCounter("GrpcInflightBytes", false))
  25. , GrpcCalls(GetCounter("GrpcCalls", true))
  26. , GrpcCallsInitialized(GetCounter("GrpcCallsInitialized", true))
  27. , DroppedMessages(GetCounter("DroppedMessages", true))
  28. , DroppedBytes(GetCounter("DroppedBytes", true))
  29. , ErrorsCount(GetCounter("ErrorsCount", true))
  30. {
  31. }
  32. }