MySQL 8.4.2
Source Code Documentation
pfs_metrics_service_imp.cc File Reference

The performance schema implementation of server metrics instrument service. More...

#include "storage/perfschema/pfs_metrics_service_imp.h"
#include <map>
#include <string>
#include "mysql/psi/mysql_rwlock.h"
#include "pfs_column_values.h"
#include "pfs_global.h"
#include "pfs_instr_class.h"

Functions

static bool invalid_metric_name (const char *name, size_t max_len)
 
static bool invalid_metric_definition (PSI_metric_info_v1 *metric)
 
static bool invalid_meter_definition (PSI_meter_info_v1 *metric)
 
void initialize_mysql_server_metrics_instrument_service ()
 
void cleanup_mysql_server_metrics_instrument_service ()
 
static int build_prefix (const LEX_CSTRING *prefix, const char *optional, char *output, size_t *output_length)
 
static void pfs_register_metrics_v1 (PSI_metric_info_v1 *info, size_t count, const char *meter)
 
void pfs_register_meters_v1 (PSI_meter_info_v1 *info, size_t count)
 
static void pfs_unregister_metrics_v1 (PSI_metric_info_v1 *info, size_t count)
 
void pfs_unregister_meters_v1 (PSI_meter_info_v1 *info, size_t count)
 
void pfs_register_change_notification_v1 (meter_registration_changes_v1_t callback)
 
void pfs_unregister_change_notification_v1 (meter_registration_changes_v1_t callback)
 
void pfs_send_change_notification_v1 (const char *meter, MeterNotifyType change)
 

Variables

mysql_rwlock_t LOCK_pfs_metrics
 
mysql_rwlock_t LOCK_pfs_meter_notify
 
static PSI_rwlock_key key_LOCK_pfs_metrics
 
static PSI_rwlock_info info_LOCK_pfs_metrics
 
static PSI_rwlock_key key_LOCK_pfs_meter_notify
 
static PSI_rwlock_info info_LOCK_pfs_meter_notify
 
static meter_registration_changes_v1_t g_notify_callback = nullptr
 
const mysql_service_psi_metric_v1_t imp_performance_schema_psi_metric_v1
 
bool server_metrics_instrument_service_initialized = false
 
constexpr int PFS_MAX_FULL_METRIC_PREFIX_NAME_LENGTH = 80
 

Detailed Description

The performance schema implementation of server metrics instrument service.

Function Documentation

◆ build_prefix()

static int build_prefix ( const LEX_CSTRING prefix,
const char *  optional,
char *  output,
size_t *  output_length 
)
static

◆ cleanup_mysql_server_metrics_instrument_service()

void cleanup_mysql_server_metrics_instrument_service ( )

◆ initialize_mysql_server_metrics_instrument_service()

void initialize_mysql_server_metrics_instrument_service ( )

◆ invalid_meter_definition()

static bool invalid_meter_definition ( PSI_meter_info_v1 metric)
static

◆ invalid_metric_definition()

static bool invalid_metric_definition ( PSI_metric_info_v1 metric)
static

◆ invalid_metric_name()

static bool invalid_metric_name ( const char *  name,
size_t  max_len 
)
static

◆ pfs_register_change_notification_v1()

void pfs_register_change_notification_v1 ( meter_registration_changes_v1_t  callback)

◆ pfs_register_meters_v1()

void pfs_register_meters_v1 ( PSI_meter_info_v1 info,
size_t  count 
)

◆ pfs_register_metrics_v1()

static void pfs_register_metrics_v1 ( PSI_metric_info_v1 info,
size_t  count,
const char *  meter 
)
static

◆ pfs_send_change_notification_v1()

void pfs_send_change_notification_v1 ( const char *  meter,
MeterNotifyType  change 
)

◆ pfs_unregister_change_notification_v1()

void pfs_unregister_change_notification_v1 ( meter_registration_changes_v1_t  callback)

◆ pfs_unregister_meters_v1()

void pfs_unregister_meters_v1 ( PSI_meter_info_v1 info,
size_t  count 
)

◆ pfs_unregister_metrics_v1()

static void pfs_unregister_metrics_v1 ( PSI_metric_info_v1 info,
size_t  count 
)
static

Variable Documentation

◆ g_notify_callback

meter_registration_changes_v1_t g_notify_callback = nullptr
static

◆ imp_performance_schema_psi_metric_v1

const mysql_service_psi_metric_v1_t imp_performance_schema_psi_metric_v1
Initial value:
= {
void pfs_unregister_change_notification_v1(meter_registration_changes_v1_t callback)
Definition: pfs_metrics_service_imp.cc:474
void pfs_register_change_notification_v1(meter_registration_changes_v1_t callback)
Definition: pfs_metrics_service_imp.cc:464
void pfs_unregister_meters_v1(PSI_meter_info_v1 *info, size_t count)
Definition: pfs_metrics_service_imp.cc:430
void pfs_register_meters_v1(PSI_meter_info_v1 *info, size_t count)
Definition: pfs_metrics_service_imp.cc:323
void pfs_send_change_notification_v1(const char *meter, MeterNotifyType change)
Definition: pfs_metrics_service_imp.cc:484

◆ info_LOCK_pfs_meter_notify

PSI_rwlock_info info_LOCK_pfs_meter_notify
static
Initial value:
= {
&key_LOCK_pfs_meter_notify, "LOCK_pfs_meter_notify", PSI_FLAG_SINGLETON, 0,
"This lock protects meter change notification callback."}
#define PSI_FLAG_SINGLETON
Singleton flag.
Definition: component_common.h:35
static PSI_rwlock_key key_LOCK_pfs_meter_notify
Definition: pfs_metrics_service_imp.cc:48

◆ info_LOCK_pfs_metrics

PSI_rwlock_info info_LOCK_pfs_metrics
static
Initial value:
= {
&key_LOCK_pfs_metrics, "LOCK_pfs_metrics", PSI_FLAG_SINGLETON, 0,
"This lock protects list of instrumented metrics."}
static PSI_rwlock_key key_LOCK_pfs_metrics
Definition: pfs_metrics_service_imp.cc:43

◆ key_LOCK_pfs_meter_notify

PSI_rwlock_key key_LOCK_pfs_meter_notify
static

◆ key_LOCK_pfs_metrics

PSI_rwlock_key key_LOCK_pfs_metrics
static

◆ LOCK_pfs_meter_notify

mysql_rwlock_t LOCK_pfs_meter_notify

◆ LOCK_pfs_metrics

mysql_rwlock_t LOCK_pfs_metrics

◆ PFS_MAX_FULL_METRIC_PREFIX_NAME_LENGTH

constexpr int PFS_MAX_FULL_METRIC_PREFIX_NAME_LENGTH = 80
constexpr

◆ server_metrics_instrument_service_initialized

bool server_metrics_instrument_service_initialized = false