aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/unified_agent_client/counters.cpp
blob: 776a86ec4eb21cd855a78ef831286e1991b79cb0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "counters.h"

using namespace NMonitoring;

namespace NUnifiedAgent {
    TClientCounters::TClientCounters(const NMonitoring::TDynamicCounterPtr& counters)
        : TDynamicCountersWrapper(counters)
        , ActiveSessionsCount(GetCounter("ActiveSessionsCount", false))
        , ClientLogDroppedBytes(GetCounter("ClientLogDroppedBytes", true))
    {
    }

    TIntrusivePtr<TClientSessionCounters> TClientCounters::GetDefaultSessionCounters() {
        auto group = Unwrap()->GetSubgroup("session", "default");
        return MakeIntrusive<TClientSessionCounters>(group);
    }

    TClientSessionCounters::TClientSessionCounters(const NMonitoring::TDynamicCounterPtr& counters)
        : TDynamicCountersWrapper(counters)
        , ReceivedMessages(GetCounter("ReceivedMessages", true))
        , ReceivedBytes(GetCounter("ReceivedBytes", true))
        , AcknowledgedMessages(GetCounter("AcknowledgedMessages", true))
        , AcknowledgedBytes(GetCounter("AcknowledgedBytes", true))
        , InflightMessages(GetCounter("InflightMessages", false))
        , InflightBytes(GetCounter("InflightBytes", false))
        , GrpcWriteBatchRequests(GetCounter("GrpcWriteBatchRequests", true))
        , GrpcInflightMessages(GetCounter("GrpcInflightMessages", false))
        , GrpcInflightBytes(GetCounter("GrpcInflightBytes", false))
        , GrpcCalls(GetCounter("GrpcCalls", true))
        , GrpcCallsInitialized(GetCounter("GrpcCallsInitialized", true))
        , DroppedMessages(GetCounter("DroppedMessages", true))
        , DroppedBytes(GetCounter("DroppedBytes", true))
        , ErrorsCount(GetCounter("ErrorsCount", true))
    {
    }
}