MySQL 26.10.0
Source Code Documentation
table_system_cpu_stats_base.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 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#ifndef TABLE_SYSTEM_CPU_STATS_BASE_INCLUDED
25#define TABLE_SYSTEM_CPU_STATS_BASE_INCLUDED
26
28
31#include "table_base.h"
32
33namespace hm {
34
37 time_t m_timestamp{0};
38 std::string m_cpu;
39 uint64_t m_user_ms{0};
40 uint64_t m_nice_ms{0};
41 uint64_t m_system_ms{0};
42 uint64_t m_idle_ms{0};
43 uint64_t m_iowait_ms{0};
44 uint64_t m_irq_ms{0};
45 uint64_t m_softirq_ms{0};
46 uint64_t m_steal_ms{0};
47 uint64_t m_guest_ms{0};
48 uint64_t m_guest_nice_ms{0};
50};
51
52// clang-format off
53
55 public:
57
58 int rnd_next() override;
59 int rnd_pos() override;
60 int read_column_value(PSI_field *field, unsigned int index) override;
61 virtual void make_row(const System_CPU_Stats &record);
62
63 protected:
65 std::shared_ptr<Stat_Buffer<System_CPU_Stats>> m_buffer;
66};
67
70 Access_control acl);
71
72} // namespace hm
73
74// clang-format on
75
76#endif // TABLE_SYSTEM_CPU_STATS_BASE_INCLUDED
Definition: table_base.h:43
Definition: table_system_cpu_stats_base.h:54
table_system_cpu_stats_row row_t
Definition: table_system_cpu_stats_base.h:56
int rnd_pos() override
Definition: table_system_cpu_stats_base.cc:46
int read_column_value(PSI_field *field, unsigned int index) override
Definition: table_system_cpu_stats_base.cc:72
int rnd_next() override
Definition: table_system_cpu_stats_base.cc:35
virtual void make_row(const System_CPU_Stats &record)
Definition: table_system_cpu_stats_base.cc:55
std::shared_ptr< Stat_Buffer< System_CPU_Stats > > m_buffer
Definition: table_system_cpu_stats_base.h:65
row_t m_row
Definition: table_system_cpu_stats_base.h:64
static int record
Definition: mysqltest.cc:195
static PFS_engine_table_share_proxy share
Definition: connection_control_pfs_table.cc:95
bool index(const std::string &value, const String &search_for, uint32_t *idx)
Definition: contains.h:76
Definition: component_command.h:29
PFS_engine_table_share_proxy * table_system_cpu_stats_base_init(PFS_engine_table_share_proxy &share, const char *table_name, Access_control acl)
Definition: table_system_cpu_stats_base.cc:129
const char * table_name
Definition: rules_table_service.cc:56
Access_control
Types of access allowed to tables.
Definition: pfs_plugin_table_service.h:435
struct PSI_field PSI_field
This is an opaque structure to denote field in plugin/component code.
Definition: pfs_plugin_table_service.h:93
A share to be initialized by plugin/component code and to be provided to add_table() service method o...
Definition: pfs_plugin_table_service.h:462
Definition: health_monitor_system_bits.h:32
Definition: table_system_cpu_stats_base.h:35
time_t m_timestamp
Definition: table_system_cpu_stats_base.h:37
uint64_t m_steal_ms
Definition: table_system_cpu_stats_base.h:46
uint64_t m_guest_nice_ms
Definition: table_system_cpu_stats_base.h:48
uint64_t m_softirq_ms
Definition: table_system_cpu_stats_base.h:45
uint64_t m_iowait_ms
Definition: table_system_cpu_stats_base.h:43
uint64_t m_irq_ms
Definition: table_system_cpu_stats_base.h:44
uint64_t m_guest_ms
Definition: table_system_cpu_stats_base.h:47
uint64_t m_idle_ms
Definition: table_system_cpu_stats_base.h:42
uint64_t m_system_ms
Definition: table_system_cpu_stats_base.h:41
std::string m_cpu
Definition: table_system_cpu_stats_base.h:38
uint64_t m_user_ms
Definition: table_system_cpu_stats_base.h:39
uint64_t m_nice_ms
Definition: table_system_cpu_stats_base.h:40
bool m_extended_times_available
Definition: table_system_cpu_stats_base.h:49