24#ifndef MYSQL_SCHEDULER_STATISTICS_INSTANCE_MONITOR_H
25#define MYSQL_SCHEDULER_STATISTICS_INSTANCE_MONITOR_H
32#include <unordered_map>
41class Statistics_instance_monitor;
43 std::reference_wrapper<Statistics_instance_monitor>;
65 template <Statistic_allowed_type Type =
long long>
66 void register_stat(
const std::string &name, std::size_t thread_num = 1,
71 template <Statistic_allowed_type Type =
long long>
78 template <Statistic_allowed_type Type =
long long>
MySQL wrapper for a mutex, template which may be specialized with a specific implementation of a mute...
Definition: mutex_wrapper.h:38
CSA statistics monitor, gathers statistics coming from different CSA threads Each statistic is a pair...
Definition: statistics_instance_monitor.h:54
Statistic_type_traits< Type >::type & get_stat(const std::string &name)
Get accumulated statistic value w/o bound checking.
Definition: statistics_instance_monitor_impl.hpp:53
void register_stat(const std::string &name, std::size_t thread_num=1, bool enable=true)
Get statistic value.
Definition: statistics_instance_monitor_impl.hpp:31
std::optional< std::reference_wrapper< typename Statistic_type_traits< Type >::type > > find_stat(const std::string &name)
Get accumulated statistic value.
Definition: statistics_instance_monitor_impl.hpp:43
Registry_type m_registry
Definition: statistics_instance_monitor.h:90
void reset()
Resets initialized statistics, use wisely.
Definition: statistics_instance_monitor.cpp:34
Statistics_instance_monitor()=default
concurrency::Mutex_key Mutex_key
Definition: statistics_instance_monitor.h:57
std::unordered_map< std::string, Sharded_counter > Registry_type
Definition: statistics_instance_monitor.h:89
void init()
Definition: statistics_instance_monitor.cpp:32
void clear()
Frees registered statistics storage for this instance.
Definition: statistics_instance_monitor.cpp:40
Mutex_wrapper Mutex
Definition: mutex_srv.h:40
PSI_mutex_key Mutex_key
Definition: mutex_srv.h:41
Definition: base_dependency_tracker.h:41
std::reference_wrapper< Statistics_instance_monitor > Statistics_instance_monitor_ref
Definition: statistics_instance_monitor.h:43
required string type
Definition: replication_group_member_actions.proto:34
Helper structure that translates types between underlying supported statistic type and concrete concu...
Definition: statistics_type_traits.h:38