MySQL 26.10.0
Source Code Documentation
health_monitor_cpu_mapping.h
Go to the documentation of this file.
1/* Copyright (c) 2026, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#pragma once
25
27
28#include <ctime>
29#include <vector>
30
32
33namespace hm {
34
35/**
36 Convert a host CPU snapshot into Health Monitor CPU records.
37
38 CPU times in Cpu_times_snapshot are required. Extended CPU times are optional
39 and will be represented as NULL in the table. For example, extended CPU times
40 are unavailable on macOS because it has no supported equivalent.
41
42 @param[in] snapshot CPU snapshot to convert
43 @param[in] timestamp Timestamp for every converted record
44 @param[in,out] output Destination records, unchanged on failure
45 @return true on success, false on failure
46*/
49 std::vector<System_CPU_Stats> &output);
50
51} // namespace hm
constexpr value_type timestamp
Definition: classic_protocol_constants.h:278
Definition: component_command.h:29
bool convert_host_cpu_snapshot(const mysql::system_info::Host_cpu_snapshot &snapshot, const time_t timestamp, std::vector< System_CPU_Stats > &output)
Convert a host CPU snapshot into Health Monitor CPU records.
Definition: health_monitor_cpu_mapping.cc:66
Host CPU capabilities collected at one collection point.
Definition: system_info.h:334