-
Notifications
You must be signed in to change notification settings - Fork 420
Expand file tree
/
Copy pathProfileEvents.cpp
More file actions
175 lines (166 loc) · 7.24 KB
/
Copy pathProfileEvents.cpp
File metadata and controls
175 lines (166 loc) · 7.24 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
// Copyright 2023 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <Common/ProfileEvents.h>
/// Available events. Add something here as you wish.
#define APPLY_FOR_EVENTS(M) \
M(Query) \
M(FileOpen) \
M(FileOpenFailed) \
M(ReadBufferFromFileDescriptorRead) \
M(ReadBufferFromFileDescriptorReadFailed) \
M(ReadBufferFromFileDescriptorReadBytes) \
M(WriteBufferFromFileDescriptorWrite) \
M(WriteBufferFromFileDescriptorWriteBytes) \
\
M(MarkCacheHits) \
M(MarkCacheMisses) \
\
M(ExternalAggregationCompressedBytes) \
M(ExternalAggregationUncompressedBytes) \
\
M(ContextLock) \
M(CreatedHTTPConnections) \
M(DNSError) \
M(S3ReadMicroseconds) \
M(S3WriteMicroseconds) \
M(S3ReadRequestsCount) \
M(S3WriteRequestsCount) \
M(S3ReadRequestsErrors) \
M(S3WriteRequestsErrors) \
M(S3ReadRequestsThrottling) \
M(S3WriteRequestsThrottling) \
M(S3ReadRequestsRedirects) \
M(S3WriteRequestsRedirects) \
\
M(RWLockAcquiredReadLocks) \
M(RWLockAcquiredWriteLocks) \
M(RWLockReadersWaitMilliseconds) \
M(RWLockWritersWaitMilliseconds) \
\
M(PSMWritePages) \
M(PSMWriteIOCalls) \
M(PSV3MBlobExpansion) \
M(PSV3MBlobReused) \
M(PSMWriteBytes) \
M(PSMBackgroundWriteBytes) \
M(PSMReadPages) \
M(PSMBackgroundReadBytes) \
\
M(PSMReadIOCalls) \
M(PSMReadBytes) \
M(PSMWriteFailed) \
M(PSMReadFailed) \
\
M(PSMVCCApplyOnCurrentBase) \
M(PSMVCCApplyOnCurrentDelta) \
M(PSMVCCApplyOnNewDelta) \
M(PSMVCCCompactOnDelta) \
M(PSMVCCCompactOnDeltaRebaseRejected) \
M(PSMVCCCompactOnBase) \
M(PSMVCCCompactOnBaseCommit) \
\
M(DMWriteBlock) \
M(DMWriteBlockNS) \
M(DMWriteFile) \
M(DMWriteFileNS) \
M(DMDeleteRange) \
M(DMDeleteRangeNS) \
M(DMAppendDeltaPrepare) \
M(DMAppendDeltaPrepareNS) \
M(DMAppendDeltaCommitMemory) \
M(DMAppendDeltaCommitMemoryNS) \
M(DMAppendDeltaCommitDisk) \
M(DMAppendDeltaCommitDiskNS) \
M(DMAppendDeltaCleanUp) \
M(DMAppendDeltaCleanUpNS) \
M(DMPlace) \
M(DMPlaceNS) \
M(DMPlaceUpsert) \
M(DMPlaceUpsertNS) \
M(DMPlaceDeleteRange) \
M(DMPlaceDeleteRangeNS) \
M(DMDeltaMerge) \
M(DMDeltaMergeNS) \
M(DMSegmentSplit) \
M(DMSegmentSplitNS) \
M(DMSegmentGetSplitPoint) \
M(DMSegmentGetSplitPointNS) \
M(DMSegmentMerge) \
M(DMSegmentMergeNS) \
M(DMFlushDeltaCache) \
M(DMFlushDeltaCacheNS) \
M(DMCleanReadRows) \
M(DMSegmentIsEmptyFastPath) \
M(DMSegmentIsEmptySlowPath) \
M(DMSegmentIngestDataByReplace) \
M(DMSegmentIngestDataIntoDelta) \
\
M(FileFSync) \
\
M(DMFileFilterNoFilter) \
M(DMFileFilterAftPKAndPackSet) \
M(DMFileFilterAftRoughSet) \
\
M(ChecksumDigestBytes) \
\
M(RaftWaitIndexTimeout) \
\
M(S3WriteBytes) \
M(S3ReadBytes) \
M(S3CreateMultipartUpload) \
M(S3UploadPart) \
M(S3CompleteMultipartUpload) \
M(S3PutObject) \
M(S3GetObject) \
M(S3HeadObject) \
M(S3ListObjects) \
M(S3DeleteObject) \
M(S3CopyObject) \
M(S3GetObjectRetry) \
M(S3PutObjectRetry) \
<<<<<<< HEAD
=======
M(S3IORead) \
M(S3IOSeek) \
M(S3IOSeekBackward) \
>>>>>>> 28e47db635 (io: Fix checksum seek at end (#10341))
M(FileCacheHit) \
M(FileCacheMiss) \
M(FileCacheEvict) \
M(S3PutDMFile) \
M(S3PutDMFileRetry) \
M(S3WriteDMFileBytes) \
M(DTDeltaIndexError)
namespace ProfileEvents
{
#define M(NAME) extern const Event NAME = __COUNTER__;
APPLY_FOR_EVENTS(M)
#undef M
constexpr Event END = __COUNTER__;
std::atomic<Count> counters[END]{}; /// Global variable, initialized by zeros.
const char * getDescription(Event event)
{
static const char * descriptions[] = {
#define M(NAME) #NAME,
APPLY_FOR_EVENTS(M)
#undef M
};
return descriptions[event];
}
Event end()
{
return END;
}
} // namespace ProfileEvents
#undef APPLY_FOR_EVENTS