Coverage Report

Created: 2026-07-14 23:39

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
16
std::shared_ptr<AtomicStatistics> FileCacheMetrics::report() {
29
16
    std::shared_ptr<AtomicStatistics> output_stats = std::make_shared<AtomicStatistics>();
30
16
    std::lock_guard lock(_mtx);
31
16
    output_stats->num_io_bytes_read_from_cache += _statistics->num_io_bytes_read_from_cache;
32
16
    output_stats->num_io_bytes_read_from_remote += _statistics->num_io_bytes_read_from_remote;
33
16
    output_stats->num_io_bytes_read_from_peer += _statistics->num_io_bytes_read_from_peer;
34
16
    output_stats->inverted_index_bytes_read_from_remote +=
35
16
            _statistics->inverted_index_bytes_read_from_remote;
36
16
    output_stats->segment_footer_index_bytes_read_from_remote +=
37
16
            _statistics->segment_footer_index_bytes_read_from_remote;
38
16
    return output_stats;
39
16
}
40
41
718k
void FileCacheMetrics::update(FileCacheStatistics* input_stats) {
42
718k
    if (_statistics == nullptr) {
43
1
        std::lock_guard<std::mutex> lock(_mtx);
44
1
        if (_statistics == nullptr) {
45
1
            _statistics = std::make_shared<AtomicStatistics>();
46
1
            register_entity();
47
1
        }
48
1
    }
49
718k
    _statistics->num_io_bytes_read_from_cache += input_stats->bytes_read_from_local;
50
718k
    _statistics->num_io_bytes_read_from_remote += input_stats->bytes_read_from_remote;
51
718k
    _statistics->num_io_bytes_read_from_peer += input_stats->bytes_read_from_peer;
52
718k
    _statistics->inverted_index_bytes_read_from_remote +=
53
718k
            input_stats->inverted_index_bytes_read_from_remote;
54
718k
    _statistics->segment_footer_index_bytes_read_from_remote +=
55
718k
            input_stats->segment_footer_index_bytes_read_from_remote;
56
718k
}
57
58
1
void FileCacheMetrics::register_entity() {
59
1
    DorisMetrics::instance()->server_entity()->register_hook(
60
1
            "block_file_cache", [this]() { update_metrics_callback(); });
61
1
}
62
63
2
void FileCacheMetrics::update_metrics_callback() {
64
2
    std::shared_ptr<AtomicStatistics> stats = report();
65
2
    DorisMetrics::instance()->num_io_bytes_read_from_cache->set_value(
66
2
            stats->num_io_bytes_read_from_cache);
67
2
    DorisMetrics::instance()->num_io_bytes_read_from_remote->set_value(
68
2
            stats->num_io_bytes_read_from_remote);
69
2
    DorisMetrics::instance()->num_io_bytes_read_from_peer->set_value(
70
2
            stats->num_io_bytes_read_from_peer);
71
2
    DorisMetrics::instance()->num_io_bytes_read_total->set_value(
72
2
            stats->num_io_bytes_read_from_cache + stats->num_io_bytes_read_from_remote +
73
2
            stats->num_io_bytes_read_from_peer);
74
2
    DorisMetrics::instance()->inverted_index_bytes_read_from_remote->set_value(
75
2
            stats->inverted_index_bytes_read_from_remote);
76
2
    DorisMetrics::instance()->segment_footer_index_bytes_read_from_remote->set_value(
77
2
            stats->segment_footer_index_bytes_read_from_remote);
78
2
}
79
80
FileCacheStatistics diff_file_cache_statistics(const FileCacheStatistics& current,
81
5
                                               const FileCacheStatistics& previous) {
82
5
    FileCacheStatistics diff;
83
215
#define SUBTRACT_FIELD(field) diff.field = current.field - previous.field
84
5
    SUBTRACT_FIELD(num_local_io_total);
85
5
    SUBTRACT_FIELD(num_remote_io_total);
86
5
    SUBTRACT_FIELD(num_peer_io_total);
87
5
    SUBTRACT_FIELD(local_io_timer);
88
5
    SUBTRACT_FIELD(bytes_read_from_local);
89
5
    SUBTRACT_FIELD(bytes_read_from_remote);
90
5
    SUBTRACT_FIELD(bytes_read_from_peer);
91
5
    SUBTRACT_FIELD(remote_io_timer);
92
5
    SUBTRACT_FIELD(peer_io_timer);
93
5
    SUBTRACT_FIELD(remote_wait_timer);
94
5
    SUBTRACT_FIELD(write_cache_io_timer);
95
5
    SUBTRACT_FIELD(bytes_write_into_cache);
96
5
    SUBTRACT_FIELD(num_skip_cache_io_total);
97
5
    SUBTRACT_FIELD(read_cache_file_directly_timer);
98
5
    SUBTRACT_FIELD(cache_get_or_set_timer);
99
5
    SUBTRACT_FIELD(lock_wait_timer);
100
5
    SUBTRACT_FIELD(get_timer);
101
5
    SUBTRACT_FIELD(set_timer);
102
103
5
    SUBTRACT_FIELD(inverted_index_num_local_io_total);
104
5
    SUBTRACT_FIELD(inverted_index_num_remote_io_total);
105
5
    SUBTRACT_FIELD(inverted_index_num_peer_io_total);
106
5
    SUBTRACT_FIELD(inverted_index_bytes_read_from_local);
107
5
    SUBTRACT_FIELD(inverted_index_bytes_read_from_remote);
108
5
    SUBTRACT_FIELD(inverted_index_bytes_read_from_peer);
109
5
    SUBTRACT_FIELD(inverted_index_local_io_timer);
110
5
    SUBTRACT_FIELD(inverted_index_remote_io_timer);
111
5
    SUBTRACT_FIELD(inverted_index_peer_io_timer);
112
5
    SUBTRACT_FIELD(inverted_index_io_timer);
113
5
    SUBTRACT_FIELD(inverted_index_write_cache_io_timer);
114
5
    SUBTRACT_FIELD(inverted_index_bytes_write_into_cache);
115
116
5
    SUBTRACT_FIELD(segment_footer_index_num_local_io_total);
117
5
    SUBTRACT_FIELD(segment_footer_index_num_remote_io_total);
118
5
    SUBTRACT_FIELD(segment_footer_index_num_peer_io_total);
119
5
    SUBTRACT_FIELD(segment_footer_index_bytes_read_from_local);
120
5
    SUBTRACT_FIELD(segment_footer_index_bytes_read_from_remote);
121
5
    SUBTRACT_FIELD(segment_footer_index_bytes_read_from_peer);
122
5
    SUBTRACT_FIELD(segment_footer_index_local_io_timer);
123
5
    SUBTRACT_FIELD(segment_footer_index_remote_io_timer);
124
5
    SUBTRACT_FIELD(segment_footer_index_peer_io_timer);
125
5
    SUBTRACT_FIELD(segment_footer_index_write_cache_io_timer);
126
5
    SUBTRACT_FIELD(segment_footer_index_bytes_write_into_cache);
127
5
    SUBTRACT_FIELD(remote_only_on_miss_triggered);
128
5
    SUBTRACT_FIELD(remote_only_on_miss_threshold_bytes);
129
5
#undef SUBTRACT_FIELD
130
5
    return diff;
131
5
}
132
133
10
FileCacheProfileReporter::FileCacheProfileReporter(RuntimeProfile* profile) : _profile(profile) {
134
10
    static const char* cache_profile = "FileCache";
135
10
    ADD_TIMER_WITH_LEVEL(profile, cache_profile, 2);
136
10
    num_local_io_total =
137
10
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NumLocalIOTotal", TUnit::UNIT, cache_profile, 1);
138
10
    num_remote_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NumRemoteIOTotal", TUnit::UNIT,
139
10
                                                       cache_profile, 1);
140
10
    num_peer_io_total =
141
10
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NumPeerIOTotal", TUnit::UNIT, cache_profile, 1);
142
10
    local_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "LocalIOUseTimer", cache_profile, 1);
143
10
    remote_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "RemoteIOUseTimer", cache_profile, 1);
144
10
    peer_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "PeerIOUseTimer", cache_profile, 1);
145
10
    remote_wait_timer =
146
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "WaitOtherDownloaderTimer", cache_profile, 1);
147
10
    write_cache_io_timer =
148
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "WriteCacheIOUseTimer", cache_profile, 1);
149
10
    bytes_write_into_cache = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "BytesWriteIntoCache",
150
10
                                                          TUnit::BYTES, cache_profile, 1);
151
10
    num_skip_cache_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NumSkipCacheIOTotal",
152
10
                                                           TUnit::UNIT, cache_profile, 1);
153
10
    bytes_scanned_from_cache = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "BytesScannedFromCache",
154
10
                                                            TUnit::BYTES, cache_profile, 1);
155
10
    bytes_scanned_from_remote = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "BytesScannedFromRemote",
156
10
                                                             TUnit::BYTES, cache_profile, 1);
157
10
    bytes_scanned_from_peer = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "BytesScannedFromPeer",
158
10
                                                           TUnit::BYTES, cache_profile, 1);
159
10
    read_cache_file_directly_timer =
160
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "ReadCacheFileDirectlyTimer", cache_profile, 1);
161
10
    cache_get_or_set_timer =
162
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "CacheGetOrSetTimer", cache_profile, 1);
163
10
    lock_wait_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "LockWaitTimer", cache_profile, 1);
164
10
    get_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "GetTimer", cache_profile, 1);
165
10
    set_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "SetTimer", cache_profile, 1);
166
10
    remote_only_on_miss_triggered = profile->AddHighWaterMarkCounter("RemoteOnlyOnMissTriggered",
167
10
                                                                     TUnit::UNIT, cache_profile, 1);
168
10
    remote_only_on_miss_threshold_bytes = profile->AddHighWaterMarkCounter(
169
10
            "RemoteOnlyOnMissThresholdBytes", TUnit::BYTES, cache_profile, 1);
170
171
10
    inverted_index_num_local_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
172
10
            profile, "InvertedIndexNumLocalIOTotal", TUnit::UNIT, cache_profile, 1);
173
10
    inverted_index_num_remote_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
174
10
            profile, "InvertedIndexNumRemoteIOTotal", TUnit::UNIT, cache_profile, 1);
175
10
    inverted_index_num_peer_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
176
10
            profile, "InvertedIndexNumPeerIOTotal", TUnit::UNIT, cache_profile, 1);
177
10
    inverted_index_bytes_scanned_from_cache = ADD_CHILD_COUNTER_WITH_LEVEL(
178
10
            profile, "InvertedIndexBytesScannedFromCache", TUnit::BYTES, cache_profile, 1);
179
10
    inverted_index_bytes_scanned_from_remote = ADD_CHILD_COUNTER_WITH_LEVEL(
180
10
            profile, "InvertedIndexBytesScannedFromRemote", TUnit::BYTES, cache_profile, 1);
181
10
    inverted_index_bytes_scanned_from_peer = ADD_CHILD_COUNTER_WITH_LEVEL(
182
10
            profile, "InvertedIndexBytesScannedFromPeer", TUnit::BYTES, cache_profile, 1);
183
10
    inverted_index_local_io_timer =
184
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "InvertedIndexLocalIOUseTimer", cache_profile, 1);
185
10
    inverted_index_remote_io_timer =
186
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "InvertedIndexRemoteIOUseTimer", cache_profile, 1);
187
10
    inverted_index_peer_io_timer =
188
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "InvertedIndexPeerIOUseTimer", cache_profile, 1);
189
10
    inverted_index_io_timer =
190
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "InvertedIndexIOTimer", cache_profile, 1);
191
10
    inverted_index_write_cache_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
192
10
            profile, "InvertedIndexWriteCacheIOUseTimer", cache_profile, 1);
193
10
    inverted_index_bytes_write_into_cache = ADD_CHILD_COUNTER_WITH_LEVEL(
194
10
            profile, "InvertedIndexBytesWriteIntoCache", TUnit::BYTES, cache_profile, 1);
195
196
10
    segment_footer_index_num_local_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
197
10
            profile, "SegmentFooterIndexNumLocalIOTotal", TUnit::UNIT, cache_profile, 1);
198
10
    segment_footer_index_num_remote_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
199
10
            profile, "SegmentFooterIndexNumRemoteIOTotal", TUnit::UNIT, cache_profile, 1);
200
10
    segment_footer_index_num_peer_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
201
10
            profile, "SegmentFooterIndexNumPeerIOTotal", TUnit::UNIT, cache_profile, 1);
202
10
    segment_footer_index_bytes_scanned_from_cache = ADD_CHILD_COUNTER_WITH_LEVEL(
203
10
            profile, "SegmentFooterIndexBytesScannedFromCache", TUnit::BYTES, cache_profile, 1);
204
10
    segment_footer_index_bytes_scanned_from_remote = ADD_CHILD_COUNTER_WITH_LEVEL(
205
10
            profile, "SegmentFooterIndexBytesScannedFromRemote", TUnit::BYTES, cache_profile, 1);
206
10
    segment_footer_index_bytes_scanned_from_peer = ADD_CHILD_COUNTER_WITH_LEVEL(
207
10
            profile, "SegmentFooterIndexBytesScannedFromPeer", TUnit::BYTES, cache_profile, 1);
208
10
    segment_footer_index_local_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
209
10
            profile, "SegmentFooterIndexLocalIOUseTimer", cache_profile, 1);
210
10
    segment_footer_index_remote_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
211
10
            profile, "SegmentFooterIndexRemoteIOUseTimer", cache_profile, 1);
212
10
    segment_footer_index_peer_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
213
10
            profile, "SegmentFooterIndexPeerIOUseTimer", cache_profile, 1);
214
10
    segment_footer_index_write_cache_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
215
10
            profile, "SegmentFooterIndexWriteCacheIOUseTimer", cache_profile, 1);
216
10
    segment_footer_index_bytes_write_into_cache = ADD_CHILD_COUNTER_WITH_LEVEL(
217
10
            profile, "SegmentFooterIndexBytesWriteIntoCache", TUnit::BYTES, cache_profile, 1);
218
219
10
    num_cross_cg_peer_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "CrossCGPeerIOTotal",
220
10
                                                              TUnit::UNIT, cache_profile, 1);
221
10
    bytes_scanned_from_cross_cg_peer = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "CrossCGPeerBytesRead",
222
10
                                                                    TUnit::BYTES, cache_profile, 1);
223
10
    cross_cg_peer_io_timer =
224
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "CrossCGPeerIOTime", cache_profile, 1);
225
10
    num_same_cg_peer_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "SameCGPeerIOTotal",
226
10
                                                             TUnit::UNIT, cache_profile, 1);
227
10
    bytes_scanned_from_same_cg_peer = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "SameCGPeerBytesRead",
228
10
                                                                   TUnit::BYTES, cache_profile, 1);
229
10
    same_cg_peer_io_timer =
230
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "SameCGPeerIOTime", cache_profile, 1);
231
10
    num_peer_race_peer_win =
232
10
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PeerRaceWin", TUnit::UNIT, cache_profile, 1);
233
10
    num_peer_race_s3_win =
234
10
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "S3RaceWin", TUnit::UNIT, cache_profile, 1);
235
10
    num_peer_lazy_fetch =
236
10
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PeerLazyFetch", TUnit::UNIT, cache_profile, 1);
237
10
    peer_lazy_fetch_timer =
238
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "PeerLazyFetchTime", cache_profile, 1);
239
10
}
240
241
14
void FileCacheProfileReporter::update(const FileCacheStatistics* statistics) const {
242
14
    COUNTER_UPDATE(num_local_io_total, statistics->num_local_io_total);
243
14
    COUNTER_UPDATE(num_remote_io_total, statistics->num_remote_io_total);
244
14
    COUNTER_UPDATE(num_peer_io_total, statistics->num_peer_io_total);
245
14
    COUNTER_UPDATE(local_io_timer, statistics->local_io_timer);
246
14
    COUNTER_UPDATE(remote_io_timer, statistics->remote_io_timer);
247
14
    COUNTER_UPDATE(peer_io_timer, statistics->peer_io_timer);
248
14
    COUNTER_UPDATE(remote_wait_timer, statistics->remote_wait_timer);
249
14
    COUNTER_UPDATE(write_cache_io_timer, statistics->write_cache_io_timer);
250
14
    COUNTER_UPDATE(bytes_write_into_cache, statistics->bytes_write_into_cache);
251
14
    COUNTER_UPDATE(num_skip_cache_io_total, statistics->num_skip_cache_io_total);
252
14
    COUNTER_UPDATE(bytes_scanned_from_cache, statistics->bytes_read_from_local);
253
14
    COUNTER_UPDATE(bytes_scanned_from_remote, statistics->bytes_read_from_remote);
254
14
    COUNTER_UPDATE(bytes_scanned_from_peer, statistics->bytes_read_from_peer);
255
14
    COUNTER_UPDATE(read_cache_file_directly_timer, statistics->read_cache_file_directly_timer);
256
14
    COUNTER_UPDATE(cache_get_or_set_timer, statistics->cache_get_or_set_timer);
257
14
    COUNTER_UPDATE(lock_wait_timer, statistics->lock_wait_timer);
258
14
    COUNTER_UPDATE(get_timer, statistics->get_timer);
259
14
    COUNTER_UPDATE(set_timer, statistics->set_timer);
260
14
    remote_only_on_miss_triggered->set(statistics->remote_only_on_miss_triggered);
261
14
    remote_only_on_miss_threshold_bytes->set(statistics->remote_only_on_miss_threshold_bytes);
262
263
14
    COUNTER_UPDATE(inverted_index_num_local_io_total,
264
14
                   statistics->inverted_index_num_local_io_total);
265
14
    COUNTER_UPDATE(inverted_index_num_remote_io_total,
266
14
                   statistics->inverted_index_num_remote_io_total);
267
14
    COUNTER_UPDATE(inverted_index_num_peer_io_total, statistics->inverted_index_num_peer_io_total);
268
14
    COUNTER_UPDATE(inverted_index_bytes_scanned_from_cache,
269
14
                   statistics->inverted_index_bytes_read_from_local);
270
14
    COUNTER_UPDATE(inverted_index_bytes_scanned_from_remote,
271
14
                   statistics->inverted_index_bytes_read_from_remote);
272
14
    COUNTER_UPDATE(inverted_index_bytes_scanned_from_peer,
273
14
                   statistics->inverted_index_bytes_read_from_peer);
274
14
    COUNTER_UPDATE(inverted_index_local_io_timer, statistics->inverted_index_local_io_timer);
275
14
    COUNTER_UPDATE(inverted_index_remote_io_timer, statistics->inverted_index_remote_io_timer);
276
14
    COUNTER_UPDATE(inverted_index_peer_io_timer, statistics->inverted_index_peer_io_timer);
277
14
    COUNTER_UPDATE(inverted_index_io_timer, statistics->inverted_index_io_timer);
278
14
    COUNTER_UPDATE(inverted_index_write_cache_io_timer,
279
14
                   statistics->inverted_index_write_cache_io_timer);
280
14
    COUNTER_UPDATE(inverted_index_bytes_write_into_cache,
281
14
                   statistics->inverted_index_bytes_write_into_cache);
282
283
14
    COUNTER_UPDATE(segment_footer_index_num_local_io_total,
284
14
                   statistics->segment_footer_index_num_local_io_total);
285
14
    COUNTER_UPDATE(segment_footer_index_num_remote_io_total,
286
14
                   statistics->segment_footer_index_num_remote_io_total);
287
14
    COUNTER_UPDATE(segment_footer_index_num_peer_io_total,
288
14
                   statistics->segment_footer_index_num_peer_io_total);
289
14
    COUNTER_UPDATE(segment_footer_index_bytes_scanned_from_cache,
290
14
                   statistics->segment_footer_index_bytes_read_from_local);
291
14
    COUNTER_UPDATE(segment_footer_index_bytes_scanned_from_remote,
292
14
                   statistics->segment_footer_index_bytes_read_from_remote);
293
14
    COUNTER_UPDATE(segment_footer_index_bytes_scanned_from_peer,
294
14
                   statistics->segment_footer_index_bytes_read_from_peer);
295
14
    COUNTER_UPDATE(segment_footer_index_local_io_timer,
296
14
                   statistics->segment_footer_index_local_io_timer);
297
14
    COUNTER_UPDATE(segment_footer_index_remote_io_timer,
298
14
                   statistics->segment_footer_index_remote_io_timer);
299
14
    COUNTER_UPDATE(segment_footer_index_peer_io_timer,
300
14
                   statistics->segment_footer_index_peer_io_timer);
301
14
    COUNTER_UPDATE(segment_footer_index_write_cache_io_timer,
302
14
                   statistics->segment_footer_index_write_cache_io_timer);
303
14
    COUNTER_UPDATE(segment_footer_index_bytes_write_into_cache,
304
14
                   statistics->segment_footer_index_bytes_write_into_cache);
305
306
14
    COUNTER_UPDATE(num_cross_cg_peer_io_total, statistics->num_cross_cg_peer_io_total);
307
14
    COUNTER_UPDATE(bytes_scanned_from_cross_cg_peer, statistics->bytes_read_from_cross_cg_peer);
308
14
    COUNTER_UPDATE(cross_cg_peer_io_timer, statistics->cross_cg_peer_io_timer);
309
14
    COUNTER_UPDATE(num_same_cg_peer_io_total, statistics->num_same_cg_peer_io_total);
310
14
    COUNTER_UPDATE(bytes_scanned_from_same_cg_peer, statistics->bytes_read_from_same_cg_peer);
311
14
    COUNTER_UPDATE(same_cg_peer_io_timer, statistics->same_cg_peer_io_timer);
312
14
    COUNTER_UPDATE(num_peer_race_peer_win, statistics->num_peer_race_peer_win);
313
14
    COUNTER_UPDATE(num_peer_race_s3_win, statistics->num_peer_race_s3_win);
314
14
    COUNTER_UPDATE(num_peer_lazy_fetch, statistics->num_peer_lazy_fetch);
315
14
    COUNTER_UPDATE(peer_lazy_fetch_timer, statistics->peer_lazy_fetch_timer);
316
317
14
    if (!statistics->peer_hosts.empty() && _profile != nullptr) {
318
1
        std::string peer_nodes;
319
2
        for (const auto& host : statistics->peer_hosts) {
320
2
            if (!peer_nodes.empty()) {
321
1
                peer_nodes += ", ";
322
1
            }
323
2
            peer_nodes += host;
324
2
        }
325
1
        _profile->add_info_string("PeerCacheNodes", peer_nodes);
326
1
    }
327
14
}
328
329
} // namespace doris::io