-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathpart2_counters.h
102 lines (74 loc) · 3.62 KB
/
part2_counters.h
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#pragma once
#include "public.h"
#include "part2_events_private.h"
#include "part2_tx.h"
#include <cloud/blockstore/libs/storage/api/partition2.h>
#include <cloud/blockstore/libs/storage/api/service.h>
#include <cloud/blockstore/libs/storage/api/volume.h>
#include <cloud/blockstore/libs/storage/core/tablet_counters.h>
#include <contrib/ydb/core/tablet/tablet_counters_protobuf.h>
namespace NCloud::NBlockStore::NStorage::NPartition2 {
////////////////////////////////////////////////////////////////////////////////
#define BLOCKSTORE_PARTITION2_IO_COUNTERS_(xxx, ...) \
xxx(RequestsCount, __VA_ARGS__) \
xxx(BlocksCount, __VA_ARGS__) \
xxx(ExecTime, __VA_ARGS__) \
xxx(WaitTime, __VA_ARGS__) \
// BLOCKSTORE_PARTITION2_IO_COUNTERS_
#define BLOCKSTORE_PARTITION2_IO_COUNTERS(xxx) \
BLOCKSTORE_PARTITION2_IO_COUNTERS_(xxx, UserRead) \
BLOCKSTORE_PARTITION2_IO_COUNTERS_(xxx, UserWrite) \
BLOCKSTORE_PARTITION2_IO_COUNTERS_(xxx, SysRead) \
BLOCKSTORE_PARTITION2_IO_COUNTERS_(xxx, SysWrite) \
// BLOCKSTORE_PARTITION2_IO_COUNTERS
#define BLOCKSTORE_PARTITION2_SIMPLE_COUNTERS(xxx) \
// BLOCKSTORE_PARTITION2_SIMPLE_COUNTERS
#define BLOCKSTORE_PARTITION2_CUMULATIVE_COUNTERS(xxx) \
BLOCKSTORE_PARTITION2_IO_COUNTERS(xxx) \
// BLOCKSTORE_PARTITION2_CUMULATIVE_COUNTERS
#define BLOCKSTORE_PARTITION2_PERCENTILE_COUNTERS(xxx) \
// BLOCKSTORE_PARTITION2_PERCENTILE_COUNTERS
////////////////////////////////////////////////////////////////////////////////
struct TPartitionCounters
{
enum ESimpleCounter
{
#define BLOCKSTORE_SIMPLE_COUNTER(name, category, ...) \
SIMPLE_COUNTER_##category##_##name,
BLOCKSTORE_PARTITION2_SIMPLE_COUNTERS(BLOCKSTORE_SIMPLE_COUNTER)
SIMPLE_COUNTER_SIZE
#undef BLOCKSTORE_SIMPLE_COUNTER
};
static const char* const SimpleCounterNames[SIMPLE_COUNTER_SIZE];
enum ECumulativeCounter
{
#define BLOCKSTORE_CUMULATIVE_COUNTER(name, category, ...) \
CUMULATIVE_COUNTER_##category##_##name,
BLOCKSTORE_PARTITION2_CUMULATIVE_COUNTERS(BLOCKSTORE_CUMULATIVE_COUNTER)
CUMULATIVE_COUNTER_SIZE
#undef BLOCKSTORE_CUMULATIVE_COUNTER
};
static const char* const CumulativeCounterNames[CUMULATIVE_COUNTER_SIZE];
enum EPercentileCounter
{
#define BLOCKSTORE_PERCENTILE_COUNTER(name, category, ...) \
PERCENTILE_COUNTER_##category##_##name,
BLOCKSTORE_PARTITION2_PERCENTILE_COUNTERS(BLOCKSTORE_PERCENTILE_COUNTER)
PERCENTILE_COUNTER_SIZE
#undef BLOCKSTORE_PERCENTILE_COUNTER
};
static const char* const PercentileCounterNames[PERCENTILE_COUNTER_SIZE];
enum ETransactionType
{
#define BLOCKSTORE_TRANSACTION_TYPE(name, ...) TX_##name,
BLOCKSTORE_PARTITION2_TRANSACTIONS(BLOCKSTORE_TRANSACTION_TYPE)
TX_SIZE
#undef BLOCKSTORE_TRANSACTION_TYPE
};
static const char* const TransactionTypeNames[TX_SIZE];
};
////////////////////////////////////////////////////////////////////////////////
std::unique_ptr<NKikimr::TTabletCountersWithTxTypes> CreatePartitionCounters();
template <typename TCounters>
void UpdatePartitionCounters(TCounters& dst, const NProto::TPartitionStats& src);
} // namespace NCloud::NBlockStore::NStorage::NPartition2