Coverage Report

Created: 2026-07-24 22:25

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/io/cache/block_file_cache_profile.cpp
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#include "io/cache/block_file_cache_profile.h"
19
20
#include <functional>
21
#include <memory>
22
#include <string>
23
24
#include "common/metrics/doris_metrics.h"
25
26
namespace doris::io {
27
28
32
std::shared_ptr<AtomicStatistics> FileCacheMetrics::report() {
29
32
    std::shared_ptr<AtomicStatistics> output_stats = std::make_shared<AtomicStatistics>();
30
32
    std::lock_guard lock(_mtx);
31
32
    output_stats->num_io_bytes_read_from_cache += _statistics->num_io_bytes_read_from_cache;
32
32
    output_stats->num_io_bytes_read_from_remote += _statistics->num_io_bytes_read_from_remote;
33
32
    output_stats->num_io_bytes_read_from_peer += _statistics->num_io_bytes_read_from_peer;
34
32
    output_stats->inverted_index_bytes_read_from_remote +=
35
32
            _statistics->inverted_index_bytes_read_from_remote;
36
32
    output_stats->segment_footer_index_bytes_read_from_remote +=
37
32
            _statistics->segment_footer_index_bytes_read_from_remote;
38
32
    return output_stats;
39
32
}
40
41
1.43M
void FileCacheMetrics::update(FileCacheStatistics* input_stats) {
42
1.43M
    if (_statistics == nullptr) {
43
2
        std::lock_guard<std::mutex> lock(_mtx);
44
2
        if (_statistics == nullptr) {
45
2
            _statistics = std::make_shared<AtomicStatistics>();
46
2
            register_entity();
47
2
        }
48
2
    }
49
1.43M
    _statistics->num_io_bytes_read_from_cache += input_stats->bytes_read_from_local;
50
1.43M
    _statistics->num_io_bytes_read_from_remote += input_stats->bytes_read_from_remote;
51
1.43M
    _statistics->num_io_bytes_read_from_peer += input_stats->bytes_read_from_peer;
52
1.43M
    _statistics->inverted_index_bytes_read_from_remote +=
53
1.43M
            input_stats->inverted_index_bytes_read_from_remote;
54
1.43M
    _statistics->segment_footer_index_bytes_read_from_remote +=
55
1.43M
            input_stats->segment_footer_index_bytes_read_from_remote;
56
1.43M
}
57
58
2
void FileCacheMetrics::register_entity() {
59
2
    DorisMetrics::instance()->server_entity()->register_hook(
60
2
            "block_file_cache", [this]() { update_metrics_callback(); });
61
2
}
62
63
4
void FileCacheMetrics::update_metrics_callback() {
64
4
    std::shared_ptr<AtomicStatistics> stats = report();
65
4
    DorisMetrics::instance()->num_io_bytes_read_from_cache->set_value(
66
4
            stats->num_io_bytes_read_from_cache);
67
4
    DorisMetrics::instance()->num_io_bytes_read_from_remote->set_value(
68
4
            stats->num_io_bytes_read_from_remote);
69
4
    DorisMetrics::instance()->num_io_bytes_read_from_peer->set_value(
70
4
            stats->num_io_bytes_read_from_peer);
71
4
    DorisMetrics::instance()->num_io_bytes_read_total->set_value(
72
4
            stats->num_io_bytes_read_from_cache + stats->num_io_bytes_read_from_remote +
73
4
            stats->num_io_bytes_read_from_peer);
74
4
    DorisMetrics::instance()->inverted_index_bytes_read_from_remote->set_value(
75
4
            stats->inverted_index_bytes_read_from_remote);
76
4
    DorisMetrics::instance()->segment_footer_index_bytes_read_from_remote->set_value(
77
4
            stats->segment_footer_index_bytes_read_from_remote);
78
4
}
79
80
FileCacheStatistics diff_file_cache_statistics(const FileCacheStatistics& current,
81
10
                                               const FileCacheStatistics& previous) {
82
10
    FileCacheStatistics diff;
83
530
#define SUBTRACT_FIELD(field) diff.field = current.field - previous.field
84
10
    SUBTRACT_FIELD(num_local_io_total);
85
10
    SUBTRACT_FIELD(num_remote_io_total);
86
10
    SUBTRACT_FIELD(num_peer_io_total);
87
10
    SUBTRACT_FIELD(local_io_timer);
88
10
    SUBTRACT_FIELD(bytes_read_from_local);
89
10
    SUBTRACT_FIELD(bytes_read_from_remote);
90
10
    SUBTRACT_FIELD(bytes_read_from_peer);
91
10
    SUBTRACT_FIELD(remote_io_timer);
92
10
    SUBTRACT_FIELD(peer_io_timer);
93
10
    SUBTRACT_FIELD(remote_wait_timer);
94
10
    SUBTRACT_FIELD(write_cache_io_timer);
95
10
    SUBTRACT_FIELD(bytes_write_into_cache);
96
10
    SUBTRACT_FIELD(num_skip_cache_io_total);
97
10
    SUBTRACT_FIELD(read_cache_file_directly_timer);
98
10
    SUBTRACT_FIELD(cache_get_or_set_timer);
99
10
    SUBTRACT_FIELD(lock_wait_timer);
100
10
    SUBTRACT_FIELD(get_timer);
101
10
    SUBTRACT_FIELD(set_timer);
102
103
10
    SUBTRACT_FIELD(inverted_index_num_local_io_total);
104
10
    SUBTRACT_FIELD(inverted_index_num_remote_io_total);
105
10
    SUBTRACT_FIELD(inverted_index_num_peer_io_total);
106
10
    SUBTRACT_FIELD(inverted_index_bytes_read_from_local);
107
10
    SUBTRACT_FIELD(inverted_index_bytes_read_from_remote);
108
10
    SUBTRACT_FIELD(inverted_index_bytes_read_from_peer);
109
10
    SUBTRACT_FIELD(inverted_index_local_io_timer);
110
10
    SUBTRACT_FIELD(inverted_index_remote_io_timer);
111
10
    SUBTRACT_FIELD(inverted_index_peer_io_timer);
112
10
    SUBTRACT_FIELD(inverted_index_io_timer);
113
10
    SUBTRACT_FIELD(inverted_index_write_cache_io_timer);
114
10
    SUBTRACT_FIELD(inverted_index_bytes_write_into_cache);
115
116
10
    SUBTRACT_FIELD(segment_footer_index_num_local_io_total);
117
10
    SUBTRACT_FIELD(segment_footer_index_num_remote_io_total);
118
10
    SUBTRACT_FIELD(segment_footer_index_num_peer_io_total);
119
10
    SUBTRACT_FIELD(segment_footer_index_bytes_read_from_local);
120
10
    SUBTRACT_FIELD(segment_footer_index_bytes_read_from_remote);
121
10
    SUBTRACT_FIELD(segment_footer_index_bytes_read_from_peer);
122
10
    SUBTRACT_FIELD(segment_footer_index_local_io_timer);
123
10
    SUBTRACT_FIELD(segment_footer_index_remote_io_timer);
124
10
    SUBTRACT_FIELD(segment_footer_index_peer_io_timer);
125
10
    SUBTRACT_FIELD(segment_footer_index_write_cache_io_timer);
126
10
    SUBTRACT_FIELD(segment_footer_index_bytes_write_into_cache);
127
10
    SUBTRACT_FIELD(remote_only_on_miss_triggered);
128
10
    SUBTRACT_FIELD(remote_only_on_miss_threshold_bytes);
129
130
10
    SUBTRACT_FIELD(num_cross_cg_peer_io_total);
131
10
    SUBTRACT_FIELD(bytes_read_from_cross_cg_peer);
132
10
    SUBTRACT_FIELD(cross_cg_peer_io_timer);
133
10
    SUBTRACT_FIELD(num_same_cg_peer_io_total);
134
10
    SUBTRACT_FIELD(bytes_read_from_same_cg_peer);
135
10
    SUBTRACT_FIELD(same_cg_peer_io_timer);
136
10
    SUBTRACT_FIELD(num_peer_race_peer_win);
137
10
    SUBTRACT_FIELD(num_peer_race_s3_win);
138
10
    SUBTRACT_FIELD(num_peer_lazy_fetch);
139
10
    SUBTRACT_FIELD(peer_lazy_fetch_timer);
140
10
#undef SUBTRACT_FIELD
141
10
    return diff;
142
10
}
143
144
FileCacheProfileReporter::FileCacheProfileReporter(RuntimeProfile* profile,
145
                                                   const std::string& parent_counter)
146
20
        : _profile(profile) {
147
20
    static const char* cache_profile = "FileCache";
148
20
    total_time = ADD_CHILD_TIMER_WITH_LEVEL(profile, cache_profile, parent_counter.c_str(), 2);
149
20
    num_local_io_total =
150
20
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NumLocalIOTotal", TUnit::UNIT, cache_profile, 1);
151
20
    num_remote_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NumRemoteIOTotal", TUnit::UNIT,
152
20
                                                       cache_profile, 1);
153
20
    num_peer_io_total =
154
20
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NumPeerIOTotal", TUnit::UNIT, cache_profile, 1);
155
20
    local_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "LocalIOUseTimer", cache_profile, 1);
156
20
    remote_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "RemoteIOUseTimer", cache_profile, 1);
157
20
    peer_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "PeerIOUseTimer", cache_profile, 1);
158
20
    remote_wait_timer =
159
20
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "WaitOtherDownloaderTimer", cache_profile, 1);
160
20
    write_cache_io_timer =
161
20
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "WriteCacheIOUseTimer", cache_profile, 1);
162
20
    bytes_write_into_cache = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "BytesWriteIntoCache",
163
20
                                                          TUnit::BYTES, cache_profile, 1);
164
20
    num_skip_cache_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NumSkipCacheIOTotal",
165
20
                                                           TUnit::UNIT, cache_profile, 1);
166
20
    bytes_scanned_from_cache = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "BytesScannedFromCache",
167
20
                                                            TUnit::BYTES, cache_profile, 1);
168
20
    bytes_scanned_from_remote = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "BytesScannedFromRemote",
169
20
                                                             TUnit::BYTES, cache_profile, 1);
170
20
    bytes_scanned_from_peer = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "BytesScannedFromPeer",
171
20
                                                           TUnit::BYTES, cache_profile, 1);
172
20
    read_cache_file_directly_timer =
173
20
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "ReadCacheFileDirectlyTimer", cache_profile, 1);
174
20
    cache_get_or_set_timer =
175
20
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "CacheGetOrSetTimer", cache_profile, 1);
176
20
    lock_wait_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "LockWaitTimer", cache_profile, 1);
177
20
    get_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "GetTimer", cache_profile, 1);
178
20
    set_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "SetTimer", cache_profile, 1);
179
20
    remote_only_on_miss_triggered = profile->AddHighWaterMarkCounter("RemoteOnlyOnMissTriggered",
180
20
                                                                     TUnit::UNIT, cache_profile, 1);
181
20
    remote_only_on_miss_threshold_bytes = profile->AddHighWaterMarkCounter(
182
20
            "RemoteOnlyOnMissThresholdBytes", TUnit::BYTES, cache_profile, 1);
183
184
20
    inverted_index_num_local_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
185
20
            profile, "InvertedIndexNumLocalIOTotal", TUnit::UNIT, cache_profile, 1);
186
20
    inverted_index_num_remote_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
187
20
            profile, "InvertedIndexNumRemoteIOTotal", TUnit::UNIT, cache_profile, 1);
188
20
    inverted_index_num_peer_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
189
20
            profile, "InvertedIndexNumPeerIOTotal", TUnit::UNIT, cache_profile, 1);
190
20
    inverted_index_bytes_scanned_from_cache = ADD_CHILD_COUNTER_WITH_LEVEL(
191
20
            profile, "InvertedIndexBytesScannedFromCache", TUnit::BYTES, cache_profile, 1);
192
20
    inverted_index_bytes_scanned_from_remote = ADD_CHILD_COUNTER_WITH_LEVEL(
193
20
            profile, "InvertedIndexBytesScannedFromRemote", TUnit::BYTES, cache_profile, 1);
194
20
    inverted_index_bytes_scanned_from_peer = ADD_CHILD_COUNTER_WITH_LEVEL(
195
20
            profile, "InvertedIndexBytesScannedFromPeer", TUnit::BYTES, cache_profile, 1);
196
20
    inverted_index_local_io_timer =
197
20
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "InvertedIndexLocalIOUseTimer", cache_profile, 1);
198
20
    inverted_index_remote_io_timer =
199
20
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "InvertedIndexRemoteIOUseTimer", cache_profile, 1);
200
20
    inverted_index_peer_io_timer =
201
20
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "InvertedIndexPeerIOUseTimer", cache_profile, 1);
202
20
    inverted_index_io_timer =
203
20
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "InvertedIndexIOTimer", cache_profile, 1);
204
20
    inverted_index_write_cache_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
205
20
            profile, "InvertedIndexWriteCacheIOUseTimer", cache_profile, 1);
206
20
    inverted_index_bytes_write_into_cache = ADD_CHILD_COUNTER_WITH_LEVEL(
207
20
            profile, "InvertedIndexBytesWriteIntoCache", TUnit::BYTES, cache_profile, 1);
208
209
20
    segment_footer_index_num_local_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
210
20
            profile, "SegmentFooterIndexNumLocalIOTotal", TUnit::UNIT, cache_profile, 1);
211
20
    segment_footer_index_num_remote_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
212
20
            profile, "SegmentFooterIndexNumRemoteIOTotal", TUnit::UNIT, cache_profile, 1);
213
20
    segment_footer_index_num_peer_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
214
20
            profile, "SegmentFooterIndexNumPeerIOTotal", TUnit::UNIT, cache_profile, 1);
215
20
    segment_footer_index_bytes_scanned_from_cache = ADD_CHILD_COUNTER_WITH_LEVEL(
216
20
            profile, "SegmentFooterIndexBytesScannedFromCache", TUnit::BYTES, cache_profile, 1);
217
20
    segment_footer_index_bytes_scanned_from_remote = ADD_CHILD_COUNTER_WITH_LEVEL(
218
20
            profile, "SegmentFooterIndexBytesScannedFromRemote", TUnit::BYTES, cache_profile, 1);
219
20
    segment_footer_index_bytes_scanned_from_peer = ADD_CHILD_COUNTER_WITH_LEVEL(
220
20
            profile, "SegmentFooterIndexBytesScannedFromPeer", TUnit::BYTES, cache_profile, 1);
221
20
    segment_footer_index_local_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
222
20
            profile, "SegmentFooterIndexLocalIOUseTimer", cache_profile, 1);
223
20
    segment_footer_index_remote_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
224
20
            profile, "SegmentFooterIndexRemoteIOUseTimer", cache_profile, 1);
225
20
    segment_footer_index_peer_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
226
20
            profile, "SegmentFooterIndexPeerIOUseTimer", cache_profile, 1);
227
20
    segment_footer_index_write_cache_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
228
20
            profile, "SegmentFooterIndexWriteCacheIOUseTimer", cache_profile, 1);
229
20
    segment_footer_index_bytes_write_into_cache = ADD_CHILD_COUNTER_WITH_LEVEL(
230
20
            profile, "SegmentFooterIndexBytesWriteIntoCache", TUnit::BYTES, cache_profile, 1);
231
232
20
    num_cross_cg_peer_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "CrossCGPeerIOTotal",
233
20
                                                              TUnit::UNIT, cache_profile, 1);
234
20
    bytes_scanned_from_cross_cg_peer = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "CrossCGPeerBytesRead",
235
20
                                                                    TUnit::BYTES, cache_profile, 1);
236
20
    cross_cg_peer_io_timer =
237
20
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "CrossCGPeerIOTime", cache_profile, 1);
238
20
    num_same_cg_peer_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "SameCGPeerIOTotal",
239
20
                                                             TUnit::UNIT, cache_profile, 1);
240
20
    bytes_scanned_from_same_cg_peer = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "SameCGPeerBytesRead",
241
20
                                                                   TUnit::BYTES, cache_profile, 1);
242
20
    same_cg_peer_io_timer =
243
20
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "SameCGPeerIOTime", cache_profile, 1);
244
20
    num_peer_race_peer_win =
245
20
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PeerRaceWin", TUnit::UNIT, cache_profile, 1);
246
20
    num_peer_race_s3_win =
247
20
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "S3RaceWin", TUnit::UNIT, cache_profile, 1);
248
20
    num_peer_lazy_fetch =
249
20
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PeerLazyFetch", TUnit::UNIT, cache_profile, 1);
250
20
    peer_lazy_fetch_timer =
251
20
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "PeerLazyFetchTime", cache_profile, 1);
252
20
}
253
254
28
void FileCacheProfileReporter::update(const FileCacheStatistics* statistics) const {
255
    // These are the outer cache-path phases. Their sum keeps the group timer actionable instead of
256
    // displaying zero while individual cache IO and coordination timers are non-zero.
257
28
    COUNTER_UPDATE(total_time, statistics->local_io_timer + statistics->remote_io_timer +
258
28
                                       statistics->peer_io_timer + statistics->remote_wait_timer +
259
28
                                       statistics->write_cache_io_timer +
260
28
                                       statistics->cache_get_or_set_timer);
261
28
    COUNTER_UPDATE(num_local_io_total, statistics->num_local_io_total);
262
28
    COUNTER_UPDATE(num_remote_io_total, statistics->num_remote_io_total);
263
28
    COUNTER_UPDATE(num_peer_io_total, statistics->num_peer_io_total);
264
28
    COUNTER_UPDATE(local_io_timer, statistics->local_io_timer);
265
28
    COUNTER_UPDATE(remote_io_timer, statistics->remote_io_timer);
266
28
    COUNTER_UPDATE(peer_io_timer, statistics->peer_io_timer);
267
28
    COUNTER_UPDATE(remote_wait_timer, statistics->remote_wait_timer);
268
28
    COUNTER_UPDATE(write_cache_io_timer, statistics->write_cache_io_timer);
269
28
    COUNTER_UPDATE(bytes_write_into_cache, statistics->bytes_write_into_cache);
270
28
    COUNTER_UPDATE(num_skip_cache_io_total, statistics->num_skip_cache_io_total);
271
28
    COUNTER_UPDATE(bytes_scanned_from_cache, statistics->bytes_read_from_local);
272
28
    COUNTER_UPDATE(bytes_scanned_from_remote, statistics->bytes_read_from_remote);
273
28
    COUNTER_UPDATE(bytes_scanned_from_peer, statistics->bytes_read_from_peer);
274
28
    COUNTER_UPDATE(read_cache_file_directly_timer, statistics->read_cache_file_directly_timer);
275
28
    COUNTER_UPDATE(cache_get_or_set_timer, statistics->cache_get_or_set_timer);
276
28
    COUNTER_UPDATE(lock_wait_timer, statistics->lock_wait_timer);
277
28
    COUNTER_UPDATE(get_timer, statistics->get_timer);
278
28
    COUNTER_UPDATE(set_timer, statistics->set_timer);
279
28
    remote_only_on_miss_triggered->set(statistics->remote_only_on_miss_triggered);
280
28
    remote_only_on_miss_threshold_bytes->set(statistics->remote_only_on_miss_threshold_bytes);
281
282
28
    COUNTER_UPDATE(inverted_index_num_local_io_total,
283
28
                   statistics->inverted_index_num_local_io_total);
284
28
    COUNTER_UPDATE(inverted_index_num_remote_io_total,
285
28
                   statistics->inverted_index_num_remote_io_total);
286
28
    COUNTER_UPDATE(inverted_index_num_peer_io_total, statistics->inverted_index_num_peer_io_total);
287
28
    COUNTER_UPDATE(inverted_index_bytes_scanned_from_cache,
288
28
                   statistics->inverted_index_bytes_read_from_local);
289
28
    COUNTER_UPDATE(inverted_index_bytes_scanned_from_remote,
290
28
                   statistics->inverted_index_bytes_read_from_remote);
291
28
    COUNTER_UPDATE(inverted_index_bytes_scanned_from_peer,
292
28
                   statistics->inverted_index_bytes_read_from_peer);
293
28
    COUNTER_UPDATE(inverted_index_local_io_timer, statistics->inverted_index_local_io_timer);
294
28
    COUNTER_UPDATE(inverted_index_remote_io_timer, statistics->inverted_index_remote_io_timer);
295
28
    COUNTER_UPDATE(inverted_index_peer_io_timer, statistics->inverted_index_peer_io_timer);
296
28
    COUNTER_UPDATE(inverted_index_io_timer, statistics->inverted_index_io_timer);
297
28
    COUNTER_UPDATE(inverted_index_write_cache_io_timer,
298
28
                   statistics->inverted_index_write_cache_io_timer);
299
28
    COUNTER_UPDATE(inverted_index_bytes_write_into_cache,
300
28
                   statistics->inverted_index_bytes_write_into_cache);
301
302
28
    COUNTER_UPDATE(segment_footer_index_num_local_io_total,
303
28
                   statistics->segment_footer_index_num_local_io_total);
304
28
    COUNTER_UPDATE(segment_footer_index_num_remote_io_total,
305
28
                   statistics->segment_footer_index_num_remote_io_total);
306
28
    COUNTER_UPDATE(segment_footer_index_num_peer_io_total,
307
28
                   statistics->segment_footer_index_num_peer_io_total);
308
28
    COUNTER_UPDATE(segment_footer_index_bytes_scanned_from_cache,
309
28
                   statistics->segment_footer_index_bytes_read_from_local);
310
28
    COUNTER_UPDATE(segment_footer_index_bytes_scanned_from_remote,
311
28
                   statistics->segment_footer_index_bytes_read_from_remote);
312
28
    COUNTER_UPDATE(segment_footer_index_bytes_scanned_from_peer,
313
28
                   statistics->segment_footer_index_bytes_read_from_peer);
314
28
    COUNTER_UPDATE(segment_footer_index_local_io_timer,
315
28
                   statistics->segment_footer_index_local_io_timer);
316
28
    COUNTER_UPDATE(segment_footer_index_remote_io_timer,
317
28
                   statistics->segment_footer_index_remote_io_timer);
318
28
    COUNTER_UPDATE(segment_footer_index_peer_io_timer,
319
28
                   statistics->segment_footer_index_peer_io_timer);
320
28
    COUNTER_UPDATE(segment_footer_index_write_cache_io_timer,
321
28
                   statistics->segment_footer_index_write_cache_io_timer);
322
28
    COUNTER_UPDATE(segment_footer_index_bytes_write_into_cache,
323
28
                   statistics->segment_footer_index_bytes_write_into_cache);
324
325
28
    COUNTER_UPDATE(num_cross_cg_peer_io_total, statistics->num_cross_cg_peer_io_total);
326
28
    COUNTER_UPDATE(bytes_scanned_from_cross_cg_peer, statistics->bytes_read_from_cross_cg_peer);
327
28
    COUNTER_UPDATE(cross_cg_peer_io_timer, statistics->cross_cg_peer_io_timer);
328
28
    COUNTER_UPDATE(num_same_cg_peer_io_total, statistics->num_same_cg_peer_io_total);
329
28
    COUNTER_UPDATE(bytes_scanned_from_same_cg_peer, statistics->bytes_read_from_same_cg_peer);
330
28
    COUNTER_UPDATE(same_cg_peer_io_timer, statistics->same_cg_peer_io_timer);
331
28
    COUNTER_UPDATE(num_peer_race_peer_win, statistics->num_peer_race_peer_win);
332
28
    COUNTER_UPDATE(num_peer_race_s3_win, statistics->num_peer_race_s3_win);
333
28
    COUNTER_UPDATE(num_peer_lazy_fetch, statistics->num_peer_lazy_fetch);
334
28
    COUNTER_UPDATE(peer_lazy_fetch_timer, statistics->peer_lazy_fetch_timer);
335
336
28
    if (!statistics->peer_hosts.empty() && _profile != nullptr) {
337
2
        std::string peer_nodes;
338
4
        for (const auto& host : statistics->peer_hosts) {
339
4
            if (!peer_nodes.empty()) {
340
2
                peer_nodes += ", ";
341
2
            }
342
4
            peer_nodes += host;
343
4
        }
344
2
        _profile->add_info_string("PeerCacheNodes", peer_nodes);
345
2
    }
346
28
}
347
348
} // namespace doris::io