Coverage Report

Created: 2026-07-19 18:32

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/common/metrics/doris_metrics.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 "common/metrics/doris_metrics.h"
19
20
// IWYU pragma: no_include <bthread/errno.h>
21
#include <errno.h> // IWYU pragma: keep
22
#include <glog/logging.h>
23
#include <inttypes.h>
24
#include <stdio.h>
25
#include <stdlib.h>
26
#include <string.h>
27
#include <unistd.h>
28
29
#include <algorithm>
30
#include <functional>
31
#include <ostream>
32
33
#include "common/metrics/metrics.h"
34
#include "common/metrics/system_metrics.h"
35
#include "common/status.h"
36
#include "io/fs/local_file_system.h"
37
38
namespace doris {
39
namespace io {
40
struct FileInfo;
41
} // namespace io
42
43
DEFINE_COUNTER_METRIC_PROTOTYPE_3ARG(fragment_requests_total, MetricUnit::REQUESTS,
44
                                     "Total fragment requests received.");
45
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(fragment_request_duration_us, MetricUnit::MICROSECONDS);
46
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(query_scan_bytes, MetricUnit::BYTES);
47
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(query_scan_bytes_from_local, MetricUnit::BYTES);
48
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(query_scan_bytes_from_remote, MetricUnit::BYTES);
49
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(query_scan_rows, MetricUnit::ROWS);
50
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(query_scan_count, MetricUnit::NOUNIT);
51
DEFINE_COUNTER_METRIC_PROTOTYPE_3ARG(query_cache_stale_hit_total, MetricUnit::REQUESTS,
52
                                     "Query cache decisions that reused a stale entry by "
53
                                     "incremental merge.");
54
DEFINE_COUNTER_METRIC_PROTOTYPE_3ARG(query_cache_incremental_fallback_total, MetricUnit::REQUESTS,
55
                                     "Query cache decisions that could have merged incrementally "
56
                                     "but fell back to a full recompute.");
57
DEFINE_COUNTER_METRIC_PROTOTYPE_3ARG(query_cache_write_back_total, MetricUnit::REQUESTS,
58
                                     "Query cache entries handed to the cache to be written back "
59
                                     "(full or merged); admission may still turn one down.");
60
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(push_requests_success_total, MetricUnit::REQUESTS, "",
61
                                     push_requests_total, Labels({{"status", "SUCCESS"}}));
62
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(push_requests_fail_total, MetricUnit::REQUESTS, "",
63
                                     push_requests_total, Labels({{"status", "FAIL"}}));
64
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(push_request_duration_us, MetricUnit::MICROSECONDS);
65
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(push_request_write_bytes, MetricUnit::BYTES);
66
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(push_request_write_rows, MetricUnit::ROWS);
67
68
#define DEFINE_ENGINE_COUNTER_METRIC(name, type, status)                                        \
69
    DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(name, MetricUnit::REQUESTS, "", engine_requests_total, \
70
                                         Labels({{"type", #type}, {"status", #status}}));
71
72
DEFINE_ENGINE_COUNTER_METRIC(create_tablet_requests_total, create_tablet, total);
73
DEFINE_ENGINE_COUNTER_METRIC(create_tablet_requests_failed, create_tablet, failed);
74
DEFINE_ENGINE_COUNTER_METRIC(drop_tablet_requests_total, drop_tablet, total);
75
DEFINE_ENGINE_COUNTER_METRIC(report_all_tablets_requests_skip, report_all_tablets, skip)
76
DEFINE_ENGINE_COUNTER_METRIC(schema_change_requests_total, schema_change, total);
77
DEFINE_ENGINE_COUNTER_METRIC(schema_change_requests_failed, schema_change, failed);
78
DEFINE_ENGINE_COUNTER_METRIC(create_rollup_requests_total, create_rollup, total);
79
DEFINE_ENGINE_COUNTER_METRIC(create_rollup_requests_failed, create_rollup, failed);
80
DEFINE_ENGINE_COUNTER_METRIC(storage_migrate_requests_total, storage_migrate, total);
81
DEFINE_ENGINE_COUNTER_METRIC(storage_migrate_v2_requests_total, storage_migrate_v2, total);
82
DEFINE_ENGINE_COUNTER_METRIC(storage_migrate_v2_requests_failed, storage_migrate_v2, failed);
83
DEFINE_ENGINE_COUNTER_METRIC(delete_requests_total, delete, total);
84
DEFINE_ENGINE_COUNTER_METRIC(delete_requests_failed, delete, failed);
85
DEFINE_ENGINE_COUNTER_METRIC(clone_requests_total, clone, total);
86
DEFINE_ENGINE_COUNTER_METRIC(clone_requests_failed, clone, failed);
87
DEFINE_ENGINE_COUNTER_METRIC(finish_task_requests_total, finish_task, total);
88
DEFINE_ENGINE_COUNTER_METRIC(finish_task_requests_failed, finish_task, failed);
89
DEFINE_ENGINE_COUNTER_METRIC(base_compaction_request_total, base_compaction, total);
90
DEFINE_ENGINE_COUNTER_METRIC(base_compaction_request_failed, base_compaction, failed);
91
DEFINE_ENGINE_COUNTER_METRIC(cumulative_compaction_request_total, cumulative_compaction, total);
92
DEFINE_ENGINE_COUNTER_METRIC(cumulative_compaction_request_failed, cumulative_compaction, failed);
93
DEFINE_ENGINE_COUNTER_METRIC(publish_task_request_total, publish, total);
94
DEFINE_ENGINE_COUNTER_METRIC(publish_task_failed_total, publish, failed);
95
DEFINE_ENGINE_COUNTER_METRIC(alter_inverted_index_requests_total, alter_inverted_index, total);
96
DEFINE_ENGINE_COUNTER_METRIC(alter_inverted_index_requests_failed, alter_inverted_index, failed);
97
98
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(base_compaction_deltas_total, MetricUnit::ROWSETS, "",
99
                                     compaction_deltas_total, Labels({{"type", "base"}}));
100
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(cumulative_compaction_deltas_total, MetricUnit::ROWSETS, "",
101
                                     compaction_deltas_total, Labels({{"type", "cumulative"}}));
102
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(full_compaction_deltas_total, MetricUnit::ROWSETS, "",
103
                                     compaction_deltas_total, Labels({{"type", "full"}}));
104
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(base_compaction_bytes_total, MetricUnit::BYTES, "",
105
                                     compaction_bytes_total, Labels({{"type", "base"}}));
106
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(cumulative_compaction_bytes_total, MetricUnit::BYTES, "",
107
                                     compaction_bytes_total, Labels({{"type", "cumulative"}}));
108
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(full_compaction_bytes_total, MetricUnit::BYTES, "",
109
                                     compaction_bytes_total, Labels({{"type", "full"}}));
110
111
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(base_compaction_task_running_total, MetricUnit::ROWSETS, "",
112
                                     compaction_task_state_total, Labels({{"type", "base"}}));
113
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(base_compaction_task_pending_total, MetricUnit::ROWSETS, "",
114
                                     compaction_task_state_total, Labels({{"type", "base"}}));
115
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(binlog_compaction_task_running_total, MetricUnit::ROWSETS, "",
116
                                     compaction_task_state_total, Labels({{"type", "binlog"}}));
117
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(binlog_compaction_task_pending_total, MetricUnit::ROWSETS, "",
118
                                     compaction_task_state_total, Labels({{"type", "binlog"}}));
119
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(cumulative_compaction_task_running_total, MetricUnit::ROWSETS,
120
                                     "", compaction_task_state_total,
121
                                     Labels({{"type", "cumulative"}}));
122
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(cumulative_compaction_task_pending_total, MetricUnit::ROWSETS,
123
                                     "", compaction_task_state_total,
124
                                     Labels({{"type", "cumulative"}}));
125
126
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(segment_read_total, MetricUnit::OPERATIONS,
127
                                     "(segment_v2) total number of segments read", segment_read,
128
                                     Labels({{"type", "segment_read_total"}}));
129
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(
130
        segment_row_total, MetricUnit::ROWS,
131
        "(segment_v2) total number of rows in queried segments (before index pruning)",
132
        segment_read, Labels({{"type", "segment_row_total"}}));
133
134
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(condition_cache_search_count, MetricUnit::OPERATIONS,
135
                                     "number of condition cache lookups when digest != 0",
136
                                     condition_cache, Labels({{"type", "condition_cache_search"}}));
137
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(condition_cache_hit_count, MetricUnit::OPERATIONS,
138
                                     "number of condition cache hits", condition_cache,
139
                                     Labels({{"type", "condition_cache_hit"}}));
140
141
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(stream_load_txn_begin_request_total, MetricUnit::OPERATIONS,
142
                                     "", stream_load_txn_request, Labels({{"type", "begin"}}));
143
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(stream_load_txn_commit_request_total, MetricUnit::OPERATIONS,
144
                                     "", stream_load_txn_request, Labels({{"type", "commit"}}));
145
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(stream_load_txn_rollback_request_total, MetricUnit::OPERATIONS,
146
                                     "", stream_load_txn_request, Labels({{"type", "rollback"}}));
147
148
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(stream_receive_bytes_total, MetricUnit::BYTES, "", stream_load,
149
                                     Labels({{"type", "receive_bytes"}}));
150
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(stream_load_rows_total, MetricUnit::ROWS, "", stream_load,
151
                                     Labels({{"type", "load_rows"}}));
152
153
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(compaction_producer_callback_a_round_time,
154
                                     MetricUnit::ROWSETS);
155
156
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(local_compaction_read_rows_total, MetricUnit::ROWS, "",
157
                                     compaction_rows_total, Labels({{"type", "read"}}));
158
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(local_compaction_read_bytes_total, MetricUnit::BYTES, "",
159
                                     compaction_bytes_total, Labels({{"type", "read"}}));
160
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(local_compaction_write_rows_total, MetricUnit::ROWS, "",
161
                                     compaction_rows_total, Labels({{"type", "write"}}));
162
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(local_compaction_write_bytes_total, MetricUnit::BYTES, "",
163
                                     compaction_bytes_total, Labels({{"type", "write"}}));
164
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(remote_compaction_read_rows_total, MetricUnit::ROWS, "",
165
                                     compaction_rows_total, Labels({{"type", "read"}}));
166
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(remote_compaction_read_bytes_total, MetricUnit::BYTES, "",
167
                                     compaction_bytes_total, Labels({{"type", "read"}}));
168
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(remote_compaction_write_rows_total, MetricUnit::ROWS, "",
169
                                     compaction_rows_total, Labels({{"type", "write"}}));
170
DEFINE_COUNTER_METRIC_PROTOTYPE_5ARG(remote_compaction_write_bytes_total, MetricUnit::BYTES, "",
171
                                     compaction_bytes_total, Labels({{"type", "write"}}));
172
173
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(load_rows, MetricUnit::ROWS);
174
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(load_bytes, MetricUnit::BYTES);
175
176
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(routine_load_get_msg_latency, MetricUnit::MILLISECONDS);
177
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(routine_load_get_msg_count, MetricUnit::NOUNIT);
178
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(routine_load_consume_rows, MetricUnit::ROWS);
179
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(routine_load_consume_bytes, MetricUnit::BYTES);
180
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(routine_load_kinesis_get_records_latency,
181
                                     MetricUnit::MILLISECONDS);
182
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(routine_load_kinesis_get_records_count, MetricUnit::NOUNIT);
183
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(routine_load_kinesis_throttle_count, MetricUnit::NOUNIT);
184
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(routine_load_kinesis_retriable_error_count,
185
                                     MetricUnit::NOUNIT);
186
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(routine_load_kinesis_closed_shard_count, MetricUnit::NOUNIT);
187
188
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(memtable_flush_total, MetricUnit::OPERATIONS);
189
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(memtable_flush_duration_us, MetricUnit::MICROSECONDS);
190
191
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(memory_pool_bytes_total, MetricUnit::BYTES);
192
DEFINE_GAUGE_CORE_METRIC_PROTOTYPE_2ARG(process_thread_num, MetricUnit::NOUNIT);
193
DEFINE_GAUGE_CORE_METRIC_PROTOTYPE_2ARG(process_fd_num_used, MetricUnit::NOUNIT);
194
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(process_fd_num_limit_soft, MetricUnit::NOUNIT);
195
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(process_fd_num_limit_hard, MetricUnit::NOUNIT);
196
197
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(tablet_cumulative_max_compaction_score, MetricUnit::NOUNIT);
198
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(tablet_base_max_compaction_score, MetricUnit::NOUNIT);
199
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(tablet_binlog_max_compaction_score, MetricUnit::NOUNIT);
200
201
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(all_rowsets_num, MetricUnit::NOUNIT);
202
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(all_segments_num, MetricUnit::NOUNIT);
203
204
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(compaction_used_permits, MetricUnit::NOUNIT);
205
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(binlog_compaction_used_permits, MetricUnit::NOUNIT);
206
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(compaction_waitting_permits, MetricUnit::NOUNIT);
207
208
DEFINE_HISTOGRAM_METRIC_PROTOTYPE_2ARG(tablet_version_num_distribution, MetricUnit::NOUNIT);
209
210
DEFINE_GAUGE_CORE_METRIC_PROTOTYPE_2ARG(query_scan_bytes_per_second, MetricUnit::BYTES);
211
212
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(readable_blocks_total, MetricUnit::BLOCKS);
213
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(writable_blocks_total, MetricUnit::BLOCKS);
214
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(blocks_created_total, MetricUnit::OPERATIONS);
215
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(blocks_deleted_total, MetricUnit::OPERATIONS);
216
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(bytes_read_total, MetricUnit::BYTES);
217
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(bytes_written_total, MetricUnit::BYTES);
218
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(disk_sync_total, MetricUnit::OPERATIONS);
219
220
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(blocks_open_reading, MetricUnit::BLOCKS);
221
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(blocks_open_writing, MetricUnit::BLOCKS);
222
223
DEFINE_GAUGE_CORE_METRIC_PROTOTYPE_2ARG(query_cache_memory_total_byte, MetricUnit::BYTES);
224
DEFINE_GAUGE_CORE_METRIC_PROTOTYPE_2ARG(query_cache_sql_total_count, MetricUnit::NOUNIT);
225
DEFINE_GAUGE_CORE_METRIC_PROTOTYPE_2ARG(query_cache_partition_total_count, MetricUnit::NOUNIT);
226
227
DEFINE_GAUGE_CORE_METRIC_PROTOTYPE_2ARG(upload_total_byte, MetricUnit::BYTES);
228
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(upload_rowset_count, MetricUnit::ROWSETS);
229
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(upload_fail_count, MetricUnit::ROWSETS);
230
231
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(local_file_reader_total, MetricUnit::FILESYSTEM);
232
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(s3_file_reader_total, MetricUnit::FILESYSTEM);
233
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(hdfs_file_reader_total, MetricUnit::FILESYSTEM);
234
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(broker_file_reader_total, MetricUnit::FILESYSTEM);
235
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(local_file_writer_total, MetricUnit::FILESYSTEM);
236
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(s3_file_writer_total, MetricUnit::FILESYSTEM);
237
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(file_created_total, MetricUnit::FILESYSTEM);
238
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(s3_file_created_total, MetricUnit::FILESYSTEM);
239
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(local_bytes_read_total, MetricUnit::FILESYSTEM);
240
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(s3_bytes_read_total, MetricUnit::FILESYSTEM);
241
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(local_bytes_written_total, MetricUnit::FILESYSTEM);
242
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(s3_bytes_written_total, MetricUnit::FILESYSTEM);
243
244
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(local_file_open_reading, MetricUnit::FILESYSTEM);
245
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(s3_file_open_reading, MetricUnit::FILESYSTEM);
246
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(hdfs_file_open_reading, MetricUnit::FILESYSTEM);
247
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(broker_file_open_reading, MetricUnit::FILESYSTEM);
248
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(local_file_open_writing, MetricUnit::FILESYSTEM);
249
DEFINE_GAUGE_METRIC_PROTOTYPE_2ARG(s3_file_open_writing, MetricUnit::FILESYSTEM);
250
251
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(num_io_bytes_read_total, MetricUnit::OPERATIONS);
252
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(num_io_bytes_read_from_cache, MetricUnit::OPERATIONS);
253
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(num_io_bytes_read_from_remote, MetricUnit::OPERATIONS);
254
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(num_io_bytes_read_from_peer, MetricUnit::OPERATIONS);
255
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(inverted_index_bytes_read_from_remote, MetricUnit::BYTES);
256
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(segment_footer_index_bytes_read_from_remote,
257
                                     MetricUnit::BYTES);
258
259
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(udf_close_bthread_count, MetricUnit::OPERATIONS);
260
261
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(query_ctx_cnt, MetricUnit::NOUNIT);
262
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(scanner_ctx_cnt, MetricUnit::NOUNIT);
263
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(scanner_cnt, MetricUnit::NOUNIT);
264
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(scanner_task_cnt, MetricUnit::NOUNIT);
265
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(pipeline_task_queue_size, MetricUnit::NOUNIT);
266
267
DEFINE_GAUGE_CORE_METRIC_PROTOTYPE_2ARG(runtime_filter_consumer_num, MetricUnit::NOUNIT);
268
DEFINE_GAUGE_CORE_METRIC_PROTOTYPE_2ARG(runtime_filter_consumer_ready_num, MetricUnit::NOUNIT);
269
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(runtime_filter_consumer_wait_ready_ms,
270
                                     MetricUnit::MILLISECONDS);
271
DEFINE_GAUGE_CORE_METRIC_PROTOTYPE_2ARG(runtime_filter_consumer_timeout_num, MetricUnit::NOUNIT);
272
273
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(get_remote_tablet_slow_time_ms, MetricUnit::MILLISECONDS);
274
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(get_remote_tablet_slow_cnt, MetricUnit::NOUNIT);
275
276
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(ann_index_load_costs_ms, MetricUnit::MILLISECONDS);
277
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(ann_index_load_cnt, MetricUnit::NOUNIT);
278
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(ann_index_search_costs_ms, MetricUnit::MILLISECONDS);
279
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(ann_index_search_cnt, MetricUnit::NOUNIT);
280
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(ann_ivf_on_disk_fetch_page_costs_ms, MetricUnit::MILLISECONDS);
281
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(ann_ivf_on_disk_fetch_page_cnt, MetricUnit::NOUNIT);
282
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(ann_ivf_on_disk_search_costs_ms, MetricUnit::MILLISECONDS);
283
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(ann_ivf_on_disk_search_cnt, MetricUnit::NOUNIT);
284
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(ann_ivf_on_disk_cache_hit_cnt, MetricUnit::NOUNIT);
285
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(ann_ivf_on_disk_cache_miss_cnt, MetricUnit::NOUNIT);
286
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(ann_index_in_memory_cnt, MetricUnit::NOUNIT);
287
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(ann_index_in_memory_rows_cnt, MetricUnit::ROWS);
288
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(ann_index_construction, MetricUnit::NOUNIT);
289
DEFINE_COUNTER_METRIC_PROTOTYPE_2ARG(ann_index_build_index_threads, MetricUnit::NOUNIT);
290
291
const std::string DorisMetrics::_s_registry_name = "doris_be";
292
const std::string DorisMetrics::_s_hook_name = "doris_metrics";
293
294
7
DorisMetrics::DorisMetrics() : _metric_registry(_s_registry_name) {
295
7
    _server_metric_entity = _metric_registry.register_entity("server");
296
297
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, fragment_requests_total);
298
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, fragment_request_duration_us);
299
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, query_scan_bytes);
300
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, query_scan_bytes_from_local);
301
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, query_scan_bytes_from_remote);
302
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, query_scan_rows);
303
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, query_cache_stale_hit_total);
304
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, query_cache_incremental_fallback_total);
305
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, query_cache_write_back_total);
306
307
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, push_requests_success_total);
308
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, push_requests_fail_total);
309
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, push_request_duration_us);
310
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, push_request_write_bytes);
311
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, push_request_write_rows);
312
313
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, compaction_producer_callback_a_round_time);
314
315
    // engine_requests_total
316
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, create_tablet_requests_total);
317
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, create_tablet_requests_failed);
318
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, drop_tablet_requests_total);
319
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, report_all_tablets_requests_skip);
320
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, schema_change_requests_total);
321
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, schema_change_requests_failed);
322
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, create_rollup_requests_total);
323
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, create_rollup_requests_failed);
324
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, storage_migrate_requests_total);
325
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, storage_migrate_v2_requests_total);
326
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, storage_migrate_v2_requests_failed);
327
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, delete_requests_total);
328
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, delete_requests_failed);
329
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, clone_requests_total);
330
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, clone_requests_failed);
331
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, finish_task_requests_total);
332
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, finish_task_requests_failed);
333
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, base_compaction_request_total);
334
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, base_compaction_request_failed);
335
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, cumulative_compaction_request_total);
336
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, cumulative_compaction_request_failed);
337
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, publish_task_request_total);
338
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, publish_task_failed_total);
339
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, alter_inverted_index_requests_total);
340
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, alter_inverted_index_requests_failed);
341
342
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, local_compaction_read_rows_total);
343
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, local_compaction_read_bytes_total);
344
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, local_compaction_write_rows_total);
345
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, local_compaction_write_bytes_total);
346
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, remote_compaction_read_rows_total);
347
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, remote_compaction_read_bytes_total);
348
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, remote_compaction_write_rows_total);
349
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, remote_compaction_write_bytes_total);
350
351
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, base_compaction_deltas_total);
352
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, base_compaction_bytes_total);
353
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, cumulative_compaction_deltas_total);
354
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, cumulative_compaction_bytes_total);
355
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, full_compaction_deltas_total);
356
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, full_compaction_bytes_total);
357
358
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, base_compaction_task_running_total);
359
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, base_compaction_task_pending_total);
360
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, binlog_compaction_task_running_total);
361
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, binlog_compaction_task_pending_total);
362
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, cumulative_compaction_task_running_total);
363
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, cumulative_compaction_task_pending_total);
364
365
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, segment_read_total);
366
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, condition_cache_search_count);
367
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, condition_cache_hit_count);
368
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, segment_row_total);
369
370
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, stream_load_txn_begin_request_total);
371
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, stream_load_txn_commit_request_total);
372
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, stream_load_txn_rollback_request_total);
373
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, stream_receive_bytes_total);
374
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, stream_load_rows_total);
375
376
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, routine_load_get_msg_latency);
377
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, routine_load_get_msg_count);
378
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, routine_load_consume_bytes);
379
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, routine_load_consume_rows);
380
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, routine_load_kinesis_get_records_latency);
381
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, routine_load_kinesis_get_records_count);
382
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, routine_load_kinesis_throttle_count);
383
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, routine_load_kinesis_retriable_error_count);
384
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, routine_load_kinesis_closed_shard_count);
385
386
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, memtable_flush_total);
387
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, memtable_flush_duration_us);
388
389
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, memory_pool_bytes_total);
390
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, process_thread_num);
391
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, process_fd_num_used);
392
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, process_fd_num_limit_soft);
393
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, process_fd_num_limit_hard);
394
395
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, tablet_cumulative_max_compaction_score);
396
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, tablet_base_max_compaction_score);
397
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, tablet_binlog_max_compaction_score);
398
399
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, all_rowsets_num);
400
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, all_segments_num);
401
402
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, compaction_used_permits);
403
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, binlog_compaction_used_permits);
404
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, compaction_waitting_permits);
405
406
7
    HISTOGRAM_METRIC_REGISTER(_server_metric_entity, tablet_version_num_distribution);
407
408
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, query_scan_bytes_per_second);
409
410
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, load_rows);
411
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, load_bytes);
412
413
7
    INT_UGAUGE_METRIC_REGISTER(_server_metric_entity, upload_total_byte);
414
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, upload_rowset_count);
415
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, upload_fail_count);
416
417
7
    _server_metric_entity->register_hook(_s_hook_name, std::bind(&DorisMetrics::_update, this));
418
419
7
    INT_UGAUGE_METRIC_REGISTER(_server_metric_entity, query_cache_memory_total_byte);
420
7
    INT_UGAUGE_METRIC_REGISTER(_server_metric_entity, query_cache_sql_total_count);
421
7
    INT_UGAUGE_METRIC_REGISTER(_server_metric_entity, query_cache_partition_total_count);
422
423
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, local_file_reader_total);
424
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, s3_file_reader_total);
425
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, hdfs_file_reader_total);
426
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, broker_file_reader_total);
427
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, local_file_writer_total);
428
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, s3_file_writer_total);
429
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, file_created_total);
430
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, s3_file_created_total);
431
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, local_bytes_read_total);
432
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, s3_bytes_read_total);
433
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, local_bytes_written_total);
434
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, s3_bytes_written_total);
435
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, local_file_open_reading);
436
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, s3_file_open_reading);
437
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, hdfs_file_open_reading);
438
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, broker_file_open_reading);
439
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, local_file_open_writing);
440
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, s3_file_open_writing);
441
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, num_io_bytes_read_total);
442
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, num_io_bytes_read_from_cache);
443
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, num_io_bytes_read_from_remote);
444
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, num_io_bytes_read_from_peer);
445
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, inverted_index_bytes_read_from_remote);
446
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, segment_footer_index_bytes_read_from_remote);
447
448
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, udf_close_bthread_count);
449
450
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, query_ctx_cnt);
451
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_ctx_cnt);
452
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_cnt);
453
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, scanner_task_cnt);
454
455
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, runtime_filter_consumer_num);
456
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, runtime_filter_consumer_ready_num);
457
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, runtime_filter_consumer_wait_ready_ms);
458
7
    INT_GAUGE_METRIC_REGISTER(_server_metric_entity, runtime_filter_consumer_timeout_num);
459
460
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, get_remote_tablet_slow_time_ms);
461
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, get_remote_tablet_slow_cnt);
462
463
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, pipeline_task_queue_size);
464
465
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, ann_index_load_costs_ms);
466
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, ann_index_load_cnt);
467
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, ann_index_search_costs_ms);
468
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, ann_index_search_cnt);
469
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, ann_ivf_on_disk_fetch_page_costs_ms);
470
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, ann_ivf_on_disk_fetch_page_cnt);
471
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, ann_ivf_on_disk_search_costs_ms);
472
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, ann_ivf_on_disk_search_cnt);
473
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, ann_ivf_on_disk_cache_hit_cnt);
474
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, ann_ivf_on_disk_cache_miss_cnt);
475
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, ann_index_in_memory_cnt);
476
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, ann_index_in_memory_rows_cnt);
477
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, ann_index_construction);
478
7
    INT_COUNTER_METRIC_REGISTER(_server_metric_entity, ann_index_build_index_threads);
479
7
}
480
481
void DorisMetrics::initialize(bool init_system_metrics, const std::set<std::string>& disk_devices,
482
6
                              const std::vector<std::string>& network_interfaces) {
483
6
    if (init_system_metrics) {
484
2
        _system_metrics.reset(
485
2
                new SystemMetrics(&_metric_registry, disk_devices, network_interfaces));
486
2
    }
487
6
}
488
489
6
void DorisMetrics::init_jvm_metrics() {
490
6
    _jvm_metrics.reset(new JvmMetrics(&_metric_registry));
491
6
}
492
493
352
void DorisMetrics::_update() {
494
352
    _update_process_thread_num();
495
352
    _update_process_fd_num();
496
352
}
497
498
// get num of thread of doris_be process
499
// from /proc/self/task
500
352
void DorisMetrics::_update_process_thread_num() {
501
352
    std::error_code ec;
502
352
    std::filesystem::directory_iterator dict_iter("/proc/self/task/", ec);
503
352
    if (ec) {
504
0
        LOG(WARNING) << "failed to count thread num: " << ec.message();
505
0
        process_thread_num->set_value(0);
506
0
        return;
507
0
    }
508
352
    int64_t count =
509
1.02M
            std::count_if(dict_iter, std::filesystem::end(dict_iter), [](const auto& entry) {
510
1.02M
                std::error_code error_code;
511
1.02M
                return entry.is_directory(error_code) && !error_code;
512
1.02M
            });
513
514
352
    process_thread_num->set_value(count);
515
352
}
516
517
// get num of file descriptor of doris_be process
518
352
void DorisMetrics::_update_process_fd_num() {
519
    // fd used
520
352
    std::error_code ec;
521
352
    std::filesystem::directory_iterator dict_iter("/proc/self/fd/", ec);
522
352
    if (ec) {
523
0
        LOG(WARNING) << "failed to count fd: " << ec.message();
524
0
        process_fd_num_used->set_value(0);
525
0
        return;
526
0
    }
527
352
    int64_t count =
528
1.18M
            std::count_if(dict_iter, std::filesystem::end(dict_iter), [](const auto& entry) {
529
1.18M
                std::error_code error_code;
530
1.18M
                return entry.is_regular_file(error_code) && !error_code;
531
1.18M
            });
532
533
352
    process_fd_num_used->set_value(count);
534
535
    // fd limits
536
352
    FILE* fp = fopen("/proc/self/limits", "r");
537
352
    if (fp == nullptr) {
538
0
        char buf[64];
539
0
        LOG(WARNING) << "open /proc/self/limits failed, errno=" << errno
540
0
                     << ", message=" << strerror_r(errno, buf, 64);
541
0
        return;
542
0
    }
543
544
    // /proc/self/limits
545
    // Max open files            65536                65536                files
546
352
    int64_t values[2];
547
352
    size_t line_buf_size = 0;
548
352
    char* line_ptr = nullptr;
549
3.16k
    while (getline(&line_ptr, &line_buf_size, fp) > 0) {
550
3.16k
        memset(values, 0, sizeof(values));
551
3.16k
        int num = sscanf(line_ptr, "Max open files %" PRId64 " %" PRId64, &values[0], &values[1]);
552
3.16k
        if (num == 2) {
553
352
            process_fd_num_limit_soft->set_value(values[0]);
554
352
            process_fd_num_limit_hard->set_value(values[1]);
555
352
            break;
556
352
        }
557
3.16k
    }
558
559
352
    if (line_ptr != nullptr) {
560
352
        free(line_ptr);
561
352
    }
562
563
352
    if (ferror(fp) != 0) {
564
0
        char buf[64];
565
0
        LOG(WARNING) << "getline failed, errno=" << errno
566
                     << ", message=" << strerror_r(errno, buf, 64);
567
0
    }
568
352
    fclose(fp);
569
352
}
570
571
} // namespace doris