Apollo 11.0
自动驾驶开放平台
disk_resource_statistic.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17#pragma once
18
19#include <map>
20#include <set>
21#include <string>
22
23#include "modules/statistics_msgs/resource_statistic.pb.h"
24
25#include "cyber/cyber.h"
30namespace apollo {
31namespace resource_statistic {
32
34public:
39 void SetInterval(uint32_t interval) {
40 interval_ = interval;
41 }
42
47 void LoadDiskConf(const ResourceStatisticConf_DiskConf& disk_conf);
48
54 bool GetDiskMetric(DiskMetric* disk_metric);
55
56private:
57 uint32_t interval_;
58 std::set<std::string> disk_load_device_set_;
59 std::map<std::string, std::string> disk_usage_path_map_;
60 std::map<std::string, uint64_t> disk_load_pre_stat_map_;
61};
62
63} // namespace resource_statistic
64} // namespace apollo
void SetInterval(uint32_t interval)
Set timer component interval.
void LoadDiskConf(const ResourceStatisticConf_DiskConf &disk_conf)
Load disk conf.
bool GetDiskMetric(DiskMetric *disk_metric)
Get Disk metric and write it into disk_metric.
class register implement
Definition arena_queue.h:37