![]() |
MySQL 26.7.0
Source Code Documentation
|
CSA statistics monitor, gathers statistics coming from different CSA threads Each statistic is a pair of key (statistic string) and value. More...
#include <statistics_instance_monitor.h>
Public Types | |
| using | Mutex = concurrency::Mutex |
| using | Mutex_key = concurrency::Mutex_key |
Public Member Functions | |
| void | init () |
| template<Statistic_allowed_type Type = long long> | |
| void | register_stat (const std::string &name, std::size_t thread_num=1, bool enable=true) |
| Get statistic value. More... | |
| template<Statistic_allowed_type Type = long long> | |
| std::optional< std::reference_wrapper< typename Statistic_type_traits< Type >::type > > | find_stat (const std::string &name) |
| Get accumulated statistic value. More... | |
| template<Statistic_allowed_type Type = long long> | |
| Statistic_type_traits< Type >::type & | get_stat (const std::string &name) |
| Get accumulated statistic value w/o bound checking. More... | |
| void | reset () |
| Resets initialized statistics, use wisely. More... | |
| void | clear () |
| Frees registered statistics storage for this instance. More... | |
| Statistics_instance_monitor ()=default | |
Protected Types | |
| using | Registry_type = std::unordered_map< std::string, Sharded_counter > |
Protected Attributes | |
| Registry_type | m_registry |
CSA statistics monitor, gathers statistics coming from different CSA threads Each statistic is a pair of key (statistic string) and value.
This will help with backward and forward compatibility of statistics implemented in CSA servis w.r.t. statistics supported in the server Statistic update method ingests thread id, to keep a sharded statistics value until coalescing operation requested by external thread to get accumulated value (if coalescing is requested during "get" operation). For the time being, we assume only 1 channel
|
protected |
|
default |
| void mysql::scheduler::Statistics_instance_monitor::clear | ( | ) |
Frees registered statistics storage for this instance.
| std::optional< std::reference_wrapper< typename Statistic_type_traits< Type >::type > > mysql::scheduler::Statistics_instance_monitor::find_stat | ( | const std::string & | name | ) |
Get accumulated statistic value.
| name | Name of statistic |
| Statistic_type_traits< Type >::type & mysql::scheduler::Statistics_instance_monitor::get_stat | ( | const std::string & | name | ) |
Get accumulated statistic value w/o bound checking.
| name | Name of statistic |
| void mysql::scheduler::Statistics_instance_monitor::init | ( | ) |
| void mysql::scheduler::Statistics_instance_monitor::register_stat | ( | const std::string & | name, |
| std::size_t | thread_num = 1, |
||
| bool | enable = true |
||
| ) |
Get statistic value.
| name | Name of statistic |
| thread_num | The number of threads accessing statistic |
| enable | Information on whether to enable this particular statistic |
| void mysql::scheduler::Statistics_instance_monitor::reset | ( | ) |
Resets initialized statistics, use wisely.
|
protected |