MySQL 26.10.0
Source Code Documentation
health_monitor_constants.h
Go to the documentation of this file.
1/* Copyright (c) 2023, 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
26#include <climits> // ULLONG_MAX
27#include <cstdint>
28#include <limits> // numeric_limits
29
30namespace hm {
31
32static constexpr int max_int{std::numeric_limits<int>::max()};
34
35static constexpr uint64_t microseconds_per_second{1000000};
36static constexpr uint64_t hundredth_ns{10000000};
37
38static constexpr uint64_t days_per_year{365};
39static constexpr uint64_t seconds_per_minute{60};
40static constexpr uint64_t seconds_per_hour{3600};
41static constexpr uint64_t seconds_per_day{86400};
42static constexpr uint64_t seconds_per_week{seconds_per_day * 7};
43static constexpr uint64_t seconds_per_month{seconds_per_day * 30};
44static constexpr uint64_t seconds_per_year{seconds_per_day * days_per_year};
45
46static constexpr uint64_t minutes_per_hour{60};
47static constexpr uint64_t minutes_per_day{minutes_per_hour * 24};
48static constexpr uint64_t minutes_per_month{minutes_per_day * 30};
49
50static constexpr uint64_t mib{1};
51static constexpr uint64_t gib{1024 * mib};
52static constexpr uint64_t tib{1024 * gib};
53static constexpr uint64_t pib{1024 * tib};
54static constexpr uint64_t eib{1024 * pib};
55
56static constexpr int megabyte{1048576};
57static constexpr double MiB{1048576.0};
58
59enum class Yes_No { YES = 1, NO = 2 };
60
61// Test value for maximum resource level used to provoke warnings
62// TODO: Remove when the resource simulator (WL#15935) is implemented
63static constexpr uint64_t k_max_level{ULLONG_MAX - 1};
64
65} // namespace hm
Definition: component_command.h:29
static constexpr int megabyte
Definition: health_monitor_constants.h:56
static constexpr uint64_t days_per_year
Definition: health_monitor_constants.h:38
static constexpr uint64_t mib
Definition: health_monitor_constants.h:50
static constexpr uint64_t tib
Definition: health_monitor_constants.h:52
static constexpr uint64_t pib
Definition: health_monitor_constants.h:53
static constexpr uint64_t gib
Definition: health_monitor_constants.h:51
static constexpr uint64_t seconds_per_week
Definition: health_monitor_constants.h:42
static constexpr uint64_t minutes_per_hour
Definition: health_monitor_constants.h:46
static constexpr uint64_t hundredth_ns
Definition: health_monitor_constants.h:36
static constexpr uint64_t seconds_per_month
Definition: health_monitor_constants.h:43
Yes_No
Definition: health_monitor_constants.h:59
static constexpr uint64_t seconds_per_year
Definition: health_monitor_constants.h:44
static constexpr uint64_t eib
Definition: health_monitor_constants.h:54
static constexpr uint64_t max_uint64_t
Definition: health_monitor_constants.h:33
static constexpr uint64_t seconds_per_minute
Definition: health_monitor_constants.h:39
static constexpr uint64_t minutes_per_day
Definition: health_monitor_constants.h:47
static constexpr double MiB
Definition: health_monitor_constants.h:57
static constexpr uint64_t seconds_per_day
Definition: health_monitor_constants.h:41
static constexpr uint64_t k_max_level
Definition: health_monitor_constants.h:63
static constexpr int max_int
Definition: health_monitor_constants.h:32
static constexpr uint64_t microseconds_per_second
Definition: health_monitor_constants.h:35
static constexpr uint64_t minutes_per_month
Definition: health_monitor_constants.h:48
static constexpr uint64_t seconds_per_hour
Definition: health_monitor_constants.h:40
ValueType max(X &&first)
Definition: gtid.h:103