MySQL 26.7.0
Source Code Documentation
statistics_map.h
Go to the documentation of this file.
1// Copyright (c) 2026, Oracle and/or its affiliates.
2//
3// This program is free software; you can redistribute it and/or modify
4// it under the terms of the GNU General Public License, version 2.0,
5// as published by the Free Software Foundation.
6//
7// This program is designed to work with certain software (including
8// but not limited to OpenSSL) that is licensed under separate terms,
9// as designated in a particular file or component or in included license
10// documentation. The authors of MySQL hereby grant you an additional
11// permission to link the program and your derivative works with the
12// separately licensed software that they have either included with
13// the program or referenced in the documentation.
14//
15// This program is distributed in the hope that it will be useful,
16// but WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License, version 2.0, for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with this program; if not, write to the Free Software
22// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
23
24#ifndef MYSQL_CSA_STATISTICS_MAP_H
25#define MYSQL_CSA_STATISTICS_MAP_H
26
27#include <atomic>
28#include <chrono>
29#include <memory>
30#include <unordered_map>
34
35namespace mysql::csa {
36
37/// Supported statistics:
38/// * active_job_cnt - the number of currently executed jobs by thread pool
39/// workers (equal to active workers)
40/// * active_trx_cnt - the number of currently applied transactions (started
41/// transactions, active until "commit", regardless possible wait on commit
42/// order)
43/// * committed_cnt - transactions committted count
44/// * trx_exec_time - transactions execution time (all transactions executed
45/// for a particular instance id / channel id)
46/// * worker_session - session ids currently utilized by workers
47/// * session_worker - workers that currently work on a given session
48/// * trx_provided_cnt - provided transaction count (e.g. read)
49/// * trx_scheduled_cnt - scheduled transaction count
50/// * ap_queue_size - asynchronous provider queue size
51/// * applied_events_cnt - the overall, and ever-increasing, number of applied
52/// events
54 public:
55 static constexpr auto active_job_cnt = "active_job_cnt";
56 static constexpr auto active_trx_cnt = "active_trx_cnt";
57 static constexpr auto committed_cnt = "committed_cnt";
58 static constexpr auto trx_exec_time = "trx_exec_time";
59 static constexpr auto worker_session = "worker_session";
60 static constexpr auto session_worker = "session_worker";
61 static constexpr auto trx_provided_cnt = "trx_provided_cnt";
62 static constexpr auto trx_scheduled_cnt = "trx_scheduled_cnt";
63 static constexpr auto ap_queue_size = "ap_queue_size";
64 static constexpr auto applied_events_cnt = "applied_events_cnt";
65 [[nodiscard]] static bool init_statistics(std::size_t instance_id,
66 std::size_t num_threads,
67 bool enable_extended_statistics);
68};
69
70} // namespace mysql::csa
71
72#endif // MYSQL_CSA_STATISTICS_MAP_H
Supported statistics:
Definition: statistics_map.h:53
static constexpr auto ap_queue_size
Definition: statistics_map.h:63
static constexpr auto trx_scheduled_cnt
Definition: statistics_map.h:62
static constexpr auto trx_provided_cnt
Definition: statistics_map.h:61
static constexpr auto committed_cnt
Definition: statistics_map.h:57
static bool init_statistics(std::size_t instance_id, std::size_t num_threads, bool enable_extended_statistics)
Definition: statistics_map.cpp:33
static constexpr auto trx_exec_time
Definition: statistics_map.h:58
static constexpr auto active_job_cnt
Definition: statistics_map.h:55
static constexpr auto active_trx_cnt
Definition: statistics_map.h:56
static constexpr auto worker_session
Definition: statistics_map.h:59
static constexpr auto applied_events_cnt
Definition: statistics_map.h:64
static constexpr auto session_worker
Definition: statistics_map.h:60
Definition: channel.cpp:28