Coverage Report

Created: 2026-07-24 16:32

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
265
#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
130
5
    SUBTRACT_FIELD(num_cross_cg_peer_io_total);
131
5
    SUBTRACT_FIELD(bytes_read_from_cross_cg_peer);
132
5
    SUBTRACT_FIELD(cross_cg_peer_io_timer);
133
5
    SUBTRACT_FIELD(num_same_cg_peer_io_total);
134
5
    SUBTRACT_FIELD(bytes_read_from_same_cg_peer);
135
5
    SUBTRACT_FIELD(same_cg_peer_io_timer);
136
5
    SUBTRACT_FIELD(num_peer_race_peer_win);
137
5
    SUBTRACT_FIELD(num_peer_race_s3_win);
138
5
    SUBTRACT_FIELD(num_peer_lazy_fetch);
139
5
    SUBTRACT_FIELD(peer_lazy_fetch_timer);
140
5
#undef SUBTRACT_FIELD
141
5
    return diff;
142
5
}
143
144
FileCacheProfileReporter::FileCacheProfileReporter(RuntimeProfile* profile,
145
                                                   const std::string& parent_counter)
146
10
        : _profile(profile) {
147
10
    static const char* cache_profile = "FileCache";
148
10
    total_time = ADD_CHILD_TIMER_WITH_LEVEL(profile, cache_profile, parent_counter.c_str(), 2);
149
10
    num_local_io_total =
150
10
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NumLocalIOTotal", TUnit::UNIT, cache_profile, 1);
151
10
    num_remote_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NumRemoteIOTotal", TUnit::UNIT,
152
10
                                                       cache_profile, 1);
153
10
    num_peer_io_total =
154
10
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NumPeerIOTotal", TUnit::UNIT, cache_profile, 1);
155
10
    local_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "LocalIOUseTimer", cache_profile, 1);
156
10
    remote_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "RemoteIOUseTimer", cache_profile, 1);
157
10
    peer_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "PeerIOUseTimer", cache_profile, 1);
158
10
    remote_wait_timer =
159
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "WaitOtherDownloaderTimer", cache_profile, 1);
160
10
    write_cache_io_timer =
161
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "WriteCacheIOUseTimer", cache_profile, 1);
162
10
    bytes_write_into_cache = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "BytesWriteIntoCache",
163
10
                                                          TUnit::BYTES, cache_profile, 1);
164
10
    num_skip_cache_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NumSkipCacheIOTotal",
165
10
                                                           TUnit::UNIT, cache_profile, 1);
166
10
    bytes_scanned_from_cache = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "BytesScannedFromCache",
167
10
                                                            TUnit::BYTES, cache_profile, 1);
168
10
    bytes_scanned_from_remote = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "BytesScannedFromRemote",
169
10
                                                             TUnit::BYTES, cache_profile, 1);
170
10
    bytes_scanned_from_peer = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "BytesScannedFromPeer",
171
10
                                                           TUnit::BYTES, cache_profile, 1);
172
10
    read_cache_file_directly_timer =
173
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "ReadCacheFileDirectlyTimer", cache_profile, 1);
174
10
    cache_get_or_set_timer =
175
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "CacheGetOrSetTimer", cache_profile, 1);
176
10
    lock_wait_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "LockWaitTimer", cache_profile, 1);
177
10
    get_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "GetTimer", cache_profile, 1);
178
10
    set_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "SetTimer", cache_profile, 1);
179
10
    remote_only_on_miss_triggered = profile->AddHighWaterMarkCounter("RemoteOnlyOnMissTriggered",
180
10
                                                                     TUnit::UNIT, cache_profile, 1);
181
10
    remote_only_on_miss_threshold_bytes = profile->AddHighWaterMarkCounter(
182
10
            "RemoteOnlyOnMissThresholdBytes", TUnit::BYTES, cache_profile, 1);
183
184
10
    inverted_index_num_local_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
185
10
            profile, "InvertedIndexNumLocalIOTotal", TUnit::UNIT, cache_profile, 1);
186
10
    inverted_index_num_remote_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
187
10
            profile, "InvertedIndexNumRemoteIOTotal", TUnit::UNIT, cache_profile, 1);
188
10
    inverted_index_num_peer_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
189
10
            profile, "InvertedIndexNumPeerIOTotal", TUnit::UNIT, cache_profile, 1);
190
10
    inverted_index_bytes_scanned_from_cache = ADD_CHILD_COUNTER_WITH_LEVEL(
191
10
            profile, "InvertedIndexBytesScannedFromCache", TUnit::BYTES, cache_profile, 1);
192
10
    inverted_index_bytes_scanned_from_remote = ADD_CHILD_COUNTER_WITH_LEVEL(
193
10
            profile, "InvertedIndexBytesScannedFromRemote", TUnit::BYTES, cache_profile, 1);
194
10
    inverted_index_bytes_scanned_from_peer = ADD_CHILD_COUNTER_WITH_LEVEL(
195
10
            profile, "InvertedIndexBytesScannedFromPeer", TUnit::BYTES, cache_profile, 1);
196
10
    inverted_index_local_io_timer =
197
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "InvertedIndexLocalIOUseTimer", cache_profile, 1);
198
10
    inverted_index_remote_io_timer =
199
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "InvertedIndexRemoteIOUseTimer", cache_profile, 1);
200
10
    inverted_index_peer_io_timer =
201
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "InvertedIndexPeerIOUseTimer", cache_profile, 1);
202
10
    inverted_index_io_timer =
203
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "InvertedIndexIOTimer", cache_profile, 1);
204
10
    inverted_index_write_cache_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
205
10
            profile, "InvertedIndexWriteCacheIOUseTimer", cache_profile, 1);
206
10
    inverted_index_bytes_write_into_cache = ADD_CHILD_COUNTER_WITH_LEVEL(
207
10
            profile, "InvertedIndexBytesWriteIntoCache", TUnit::BYTES, cache_profile, 1);
208
209
10
    segment_footer_index_num_local_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
210
10
            profile, "SegmentFooterIndexNumLocalIOTotal", TUnit::UNIT, cache_profile, 1);
211
10
    segment_footer_index_num_remote_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
212
10
            profile, "SegmentFooterIndexNumRemoteIOTotal", TUnit::UNIT, cache_profile, 1);
213
10
    segment_footer_index_num_peer_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(
214
10
            profile, "SegmentFooterIndexNumPeerIOTotal", TUnit::UNIT, cache_profile, 1);
215
10
    segment_footer_index_bytes_scanned_from_cache = ADD_CHILD_COUNTER_WITH_LEVEL(
216
10
            profile, "SegmentFooterIndexBytesScannedFromCache", TUnit::BYTES, cache_profile, 1);
217
10
    segment_footer_index_bytes_scanned_from_remote = ADD_CHILD_COUNTER_WITH_LEVEL(
218
10
            profile, "SegmentFooterIndexBytesScannedFromRemote", TUnit::BYTES, cache_profile, 1);
219
10
    segment_footer_index_bytes_scanned_from_peer = ADD_CHILD_COUNTER_WITH_LEVEL(
220
10
            profile, "SegmentFooterIndexBytesScannedFromPeer", TUnit::BYTES, cache_profile, 1);
221
10
    segment_footer_index_local_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
222
10
            profile, "SegmentFooterIndexLocalIOUseTimer", cache_profile, 1);
223
10
    segment_footer_index_remote_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
224
10
            profile, "SegmentFooterIndexRemoteIOUseTimer", cache_profile, 1);
225
10
    segment_footer_index_peer_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
226
10
            profile, "SegmentFooterIndexPeerIOUseTimer", cache_profile, 1);
227
10
    segment_footer_index_write_cache_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(
228
10
            profile, "SegmentFooterIndexWriteCacheIOUseTimer", cache_profile, 1);
229
10
    segment_footer_index_bytes_write_into_cache = ADD_CHILD_COUNTER_WITH_LEVEL(
230
10
            profile, "SegmentFooterIndexBytesWriteIntoCache", TUnit::BYTES, cache_profile, 1);
231
232
10
    num_cross_cg_peer_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "CrossCGPeerIOTotal",
233
10
                                                              TUnit::UNIT, cache_profile, 1);
234
10
    bytes_scanned_from_cross_cg_peer = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "CrossCGPeerBytesRead",
235
10
                                                                    TUnit::BYTES, cache_profile, 1);
236
10
    cross_cg_peer_io_timer =
237
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "CrossCGPeerIOTime", cache_profile, 1);
238
10
    num_same_cg_peer_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "SameCGPeerIOTotal",
239
10
                                                             TUnit::UNIT, cache_profile, 1);
240
10
    bytes_scanned_from_same_cg_peer = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "SameCGPeerBytesRead",
241
10
                                                                   TUnit::BYTES, cache_profile, 1);
242
10
    same_cg_peer_io_timer =
243
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "SameCGPeerIOTime", cache_profile, 1);
244
10
    num_peer_race_peer_win =
245
10
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PeerRaceWin", TUnit::UNIT, cache_profile, 1);
246
10
    num_peer_race_s3_win =
247
10
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "S3RaceWin", TUnit::UNIT, cache_profile, 1);
248
10
    num_peer_lazy_fetch =
249
10
            ADD_CHILD_COUNTER_WITH_LEVEL(profile, "PeerLazyFetch", TUnit::UNIT, cache_profile, 1);
250
10
    peer_lazy_fetch_timer =
251
10
            ADD_CHILD_TIMER_WITH_LEVEL(profile, "PeerLazyFetchTime", cache_profile, 1);
252
10
}
253
254
14
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
14
    COUNTER_UPDATE(total_time, statistics->local_io_timer + statistics->remote_io_timer +
258
14
                                       statistics->peer_io_timer + statistics->remote_wait_timer +
259
14
                                       statistics->write_cache_io_timer +
260
14
                                       statistics->cache_get_or_set_timer);
261
14
    COUNTER_UPDATE(num_local_io_total, statistics->num_local_io_total);
262
14
    COUNTER_UPDATE(num_remote_io_total, statistics->num_remote_io_total);
263
14
    COUNTER_UPDATE(num_peer_io_total, statistics->num_peer_io_total);
264
14
    COUNTER_UPDATE(local_io_timer, statistics->local_io_timer);
265
14
    COUNTER_UPDATE(remote_io_timer, statistics->remote_io_timer);
266
14
    COUNTER_UPDATE(peer_io_timer, statistics->peer_io_timer);
267
14
    COUNTER_UPDATE(remote_wait_timer, statistics->remote_wait_timer);
268
14
    COUNTER_UPDATE(write_cache_io_timer, statistics->write_cache_io_timer);
269
14
    COUNTER_UPDATE(bytes_write_into_cache, statistics->bytes_write_into_cache);
270
14
    COUNTER_UPDATE(num_skip_cache_io_total, statistics->num_skip_cache_io_total);
271
14
    COUNTER_UPDATE(bytes_scanned_from_cache, statistics->bytes_read_from_local);
272
14
    COUNTER_UPDATE(bytes_scanned_from_remote, statistics->bytes_read_from_remote);
273
14
    COUNTER_UPDATE(bytes_scanned_from_peer, statistics->bytes_read_from_peer);
274
14
    COUNTER_UPDATE(read_cache_file_directly_timer, statistics->read_cache_file_directly_timer);
275
14
    COUNTER_UPDATE(cache_get_or_set_timer, statistics->cache_get_or_set_timer);
276
14
    COUNTER_UPDATE(lock_wait_timer, statistics->lock_wait_timer);
277
14
    COUNTER_UPDATE(get_timer, statistics->get_timer);
278
14
    COUNTER_UPDATE(set_timer, statistics->set_timer);
279
14
    remote_only_on_miss_triggered->set(statistics->remote_only_on_miss_triggered);
280
14
    remote_only_on_miss_threshold_bytes->set(statistics->remote_only_on_miss_threshold_bytes);
281
282
14
    COUNTER_UPDATE(inverted_index_num_local_io_total,
283
14
                   statistics->inverted_index_num_local_io_total);
284
14
    COUNTER_UPDATE(inverted_index_num_remote_io_total,
285
14
                   statistics->inverted_index_num_remote_io_total);
286
14
    COUNTER_UPDATE(inverted_index_num_peer_io_total, statistics->inverted_index_num_peer_io_total);
287
14
    COUNTER_UPDATE(inverted_index_bytes_scanned_from_cache,
288
14
                   statistics->inverted_index_bytes_read_from_local);
289
14
    COUNTER_UPDATE(inverted_index_bytes_scanned_from_remote,
290
14
                   statistics->inverted_index_bytes_read_from_remote);
291
14
    COUNTER_UPDATE(inverted_index_bytes_scanned_from_peer,
292
14
                   statistics->inverted_index_bytes_read_from_peer);
293
14
    COUNTER_UPDATE(inverted_index_local_io_timer, statistics->inverted_index_local_io_timer);
294
14
    COUNTER_UPDATE(inverted_index_remote_io_timer, statistics->inverted_index_remote_io_timer);
295
14
    COUNTER_UPDATE(inverted_index_peer_io_timer, statistics->inverted_index_peer_io_timer);
296
14
    COUNTER_UPDATE(inverted_index_io_timer, statistics->inverted_index_io_timer);
297
14
    COUNTER_UPDATE(inverted_index_write_cache_io_timer,
298
14
                   statistics->inverted_index_write_cache_io_timer);
299
14
    COUNTER_UPDATE(inverted_index_bytes_write_into_cache,
300
14
                   statistics->inverted_index_bytes_write_into_cache);
301
302
14
    COUNTER_UPDATE(segment_footer_index_num_local_io_total,
303
14
                   statistics->segment_footer_index_num_local_io_total);
304
14
    COUNTER_UPDATE(segment_footer_index_num_remote_io_total,
305
14
                   statistics->segment_footer_index_num_remote_io_total);
306
14
    COUNTER_UPDATE(segment_footer_index_num_peer_io_total,
307
14
                   statistics->segment_footer_index_num_peer_io_total);
308
14
    COUNTER_UPDATE(segment_footer_index_bytes_scanned_from_cache,
309
14
                   statistics->segment_footer_index_bytes_read_from_local);
310
14
    COUNTER_UPDATE(segment_footer_index_bytes_scanned_from_remote,
311
14
                   statistics->segment_footer_index_bytes_read_from_remote);
312
14
    COUNTER_UPDATE(segment_footer_index_bytes_scanned_from_peer,
313
14
                   statistics->segment_footer_index_bytes_read_from_peer);
314
14
    COUNTER_UPDATE(segment_footer_index_local_io_timer,
315
14
                   statistics->segment_footer_index_local_io_timer);
316
14
    COUNTER_UPDATE(segment_footer_index_remote_io_timer,
317
14
                   statistics->segment_footer_index_remote_io_timer);
318
14
    COUNTER_UPDATE(segment_footer_index_peer_io_timer,
319
14
                   statistics->segment_footer_index_peer_io_timer);
320
14
    COUNTER_UPDATE(segment_footer_index_write_cache_io_timer,
321
14
                   statistics->segment_footer_index_write_cache_io_timer);
322
14
    COUNTER_UPDATE(segment_footer_index_bytes_write_into_cache,
323
14
                   statistics->segment_footer_index_bytes_write_into_cache);
324
325
14
    COUNTER_UPDATE(num_cross_cg_peer_io_total, statistics->num_cross_cg_peer_io_total);
326
14
    COUNTER_UPDATE(bytes_scanned_from_cross_cg_peer, statistics->bytes_read_from_cross_cg_peer);
327
14
    COUNTER_UPDATE(cross_cg_peer_io_timer, statistics->cross_cg_peer_io_timer);
328
14
    COUNTER_UPDATE(num_same_cg_peer_io_total, statistics->num_same_cg_peer_io_total);
329
14
    COUNTER_UPDATE(bytes_scanned_from_same_cg_peer, statistics->bytes_read_from_same_cg_peer);
330
14
    COUNTER_UPDATE(same_cg_peer_io_timer, statistics->same_cg_peer_io_timer);
331
14
    COUNTER_UPDATE(num_peer_race_peer_win, statistics->num_peer_race_peer_win);
332
14
    COUNTER_UPDATE(num_peer_race_s3_win, statistics->num_peer_race_s3_win);
333
14
    COUNTER_UPDATE(num_peer_lazy_fetch, statistics->num_peer_lazy_fetch);
334
14
    COUNTER_UPDATE(peer_lazy_fetch_timer, statistics->peer_lazy_fetch_timer);
335
336
14
    if (!statistics->peer_hosts.empty() && _profile != nullptr) {
337
1
        std::string peer_nodes;
338
2
        for (const auto& host : statistics->peer_hosts) {
339
2
            if (!peer_nodes.empty()) {
340
1
                peer_nodes += ", ";
341
1
            }
342
2
            peer_nodes += host;
343
2
        }
344
1
        _profile->add_info_string("PeerCacheNodes", peer_nodes);
345
1
    }
346
14
}
347
348
} // namespace doris::io