MySQL 9.1.0
Source Code Documentation
psi_metric_bits.h File Reference
#include <cstddef>
#include <cstdint>
#include <mysql/components/service.h>

Go to the source code of this file.

Classes

struct  measurement_delivery_callback
 
struct  PSI_metric_info_v1
 Define a metric source, storing char pointers requires the original strings to be valid for entire lifetime of a metric (global variable), or the strings themselves to be string literals (hardcoded), the advantage is no (de)allocation code is needed here. More...
 
struct  PSI_meter_info_v1
 Define a meter source, storing char pointers requires the original strings to be valid for entire lifetime of a metric (global variable), or the strings themselves to be string literals (hardcoded), the advantage is no (de)allocation code is needed here. More...
 

Macros

#define METRIC_UNIT_BYTES   "By"
 
#define METRIC_UNIT_MILLISECONDS   "ms"
 
#define METRIC_UNIT_SECONDS   "s"
 
#define PSI_METRIC_VERSION_1   1
 Performance Schema Metric Interface number for version 1. More...
 
#define PSI_CURRENT_METRIC_VERSION   1
 Performance Schema Metric Interface number for the most recent version. More...
 

Typedefs

typedef void(* measurement_delivery_int64_0_callback_t) (void *delivery_context, int64_t value)
 
typedef void(* measurement_delivery_int64_1_callback_t) (void *delivery_context, int64_t value, const char *attr_name, const char *attr_value)
 
typedef void(* measurement_delivery_int64_n_callback_t) (void *delivery_context, int64_t value, const char **attr_name_array, const char **attr_value_array, size_t size)
 
typedef void(* measurement_delivery_double_0_callback_t) (void *delivery_context, double value)
 
typedef void(* measurement_delivery_double_1_callback_t) (void *delivery_context, double value, const char *attr_name, const char *attr_value)
 
typedef void(* measurement_delivery_double_n_callback_t) (void *delivery_context, double value, const char **attr_name_array, const char **attr_value_array, size_t size)
 
typedef measurement_delivery_callbackmeasurement_delivery_callback_t
 Set of callbacks within component code to receive the measured values (avoids data copy overhead). More...
 
typedef void(* measurement_callback_t) (void *measurement_context, measurement_delivery_callback_t delivery, void *delivery_context)
 Single metric measurement callback can return multiple measurement values. More...
 
typedef unsigned int PSI_meter_key
 
typedef unsigned int PSI_metric_key
 
typedef void(* register_meters_v1_t) (PSI_meter_info_v1 *info, size_t count)
 Register a batch of telemetry meters (metric groups), each with its metrics. More...
 
typedef void(* unregister_meters_v1_t) (PSI_meter_info_v1 *info, size_t count)
 Unregister a batch of meters and their telemetry metric sources. More...
 
typedef void(* meter_registration_changes_v1_t) (const char *meter, MeterNotifyType change)
 Callback function to notify of changes within the set of registered meters. More...
 
typedef void(* register_change_notification_v1_t) (meter_registration_changes_v1_t callback)
 Register a notification callback to track changes in the set of registered meters. More...
 
typedef void(* unregister_change_notification_v1_t) (meter_registration_changes_v1_t callback)
 Unregister a notification callback to track changes in the set of registered meters. More...
 
typedef void(* send_change_notification_v1_t) (const char *meter, MeterNotifyType change)
 Send a notification of changes in the set of registered meters. More...
 
typedef struct PSI_metric_info_v1 PSI_metric_info_v1
 
typedef PSI_metric_info_v1 PSI_metric_info
 
typedef struct PSI_meter_info_v1 PSI_meter_info_v1
 
typedef PSI_meter_info_v1 PSI_meter_info
 

Enumerations

enum  MetricOTELType { ASYNC_COUNTER , ASYNC_UPDOWN_COUNTER , ASYNC_GAUGE_COUNTER }
 
enum  MetricNumType { METRIC_INTEGER , METRIC_DOUBLE }
 
enum  MeterNotifyType { METER_ADDED , METER_REMOVED , METER_UPDATE }
 

Variables

constexpr size_t MAX_METER_NAME_LEN = 63
 
constexpr size_t MAX_METER_DESCRIPTION_LEN = 1023
 
constexpr size_t MAX_METRIC_NAME_LEN = 63
 
constexpr size_t MAX_METRIC_UNIT_LEN = 63
 
constexpr size_t MAX_METRIC_DESCRIPTION_LEN = 1023
 

Macro Definition Documentation

◆ METRIC_UNIT_BYTES

#define METRIC_UNIT_BYTES   "By"

◆ METRIC_UNIT_MILLISECONDS

#define METRIC_UNIT_MILLISECONDS   "ms"

◆ METRIC_UNIT_SECONDS

#define METRIC_UNIT_SECONDS   "s"

◆ PSI_CURRENT_METRIC_VERSION

#define PSI_CURRENT_METRIC_VERSION   1

Performance Schema Metric Interface number for the most recent version.

The most current version is PSI_METRIC_VERSION_1

◆ PSI_METRIC_VERSION_1

#define PSI_METRIC_VERSION_1   1

Performance Schema Metric Interface number for version 1.

This version is supported.

Typedef Documentation

◆ measurement_callback_t

typedef void(* measurement_callback_t) (void *measurement_context, measurement_delivery_callback_t delivery, void *delivery_context)

Single metric measurement callback can return multiple measurement values.

For example, "CPU use" metric might return values for all available CPU logical cores, each value having an attribute with matching CPU core ID.

◆ measurement_delivery_callback_t

Set of callbacks within component code to receive the measured values (avoids data copy overhead).

◆ measurement_delivery_double_0_callback_t

typedef void(* measurement_delivery_double_0_callback_t) (void *delivery_context, double value)

◆ measurement_delivery_double_1_callback_t

typedef void(* measurement_delivery_double_1_callback_t) (void *delivery_context, double value, const char *attr_name, const char *attr_value)

◆ measurement_delivery_double_n_callback_t

typedef void(* measurement_delivery_double_n_callback_t) (void *delivery_context, double value, const char **attr_name_array, const char **attr_value_array, size_t size)

◆ measurement_delivery_int64_0_callback_t

typedef void(* measurement_delivery_int64_0_callback_t) (void *delivery_context, int64_t value)

◆ measurement_delivery_int64_1_callback_t

typedef void(* measurement_delivery_int64_1_callback_t) (void *delivery_context, int64_t value, const char *attr_name, const char *attr_value)

◆ measurement_delivery_int64_n_callback_t

typedef void(* measurement_delivery_int64_n_callback_t) (void *delivery_context, int64_t value, const char **attr_name_array, const char **attr_value_array, size_t size)

◆ meter_registration_changes_v1_t

typedef void(* meter_registration_changes_v1_t) (const char *meter, MeterNotifyType change)

Callback function to notify of changes within the set of registered meters.

Parameters
metermeter name
changetype of change related to the meter

◆ PSI_meter_info

◆ PSI_meter_info_v1

◆ PSI_meter_key

typedef unsigned int PSI_meter_key

◆ PSI_metric_info

◆ PSI_metric_info_v1

◆ PSI_metric_key

typedef unsigned int PSI_metric_key

◆ register_change_notification_v1_t

typedef void(* register_change_notification_v1_t) (meter_registration_changes_v1_t callback)

Register a notification callback to track changes in the set of registered meters.

Parameters
callbackpointer to notification function

◆ register_meters_v1_t

typedef void(* register_meters_v1_t) (PSI_meter_info_v1 *info, size_t count)

Register a batch of telemetry meters (metric groups), each with its metrics.

Parameters
infopointer to an array of meter definitions
countarray size

◆ send_change_notification_v1_t

typedef void(* send_change_notification_v1_t) (const char *meter, MeterNotifyType change)

Send a notification of changes in the set of registered meters.

Parameters
metermeter name being changed
changechange type description

◆ unregister_change_notification_v1_t

typedef void(* unregister_change_notification_v1_t) (meter_registration_changes_v1_t callback)

Unregister a notification callback to track changes in the set of registered meters.

Parameters
callbackpointer to notification function

◆ unregister_meters_v1_t

typedef void(* unregister_meters_v1_t) (PSI_meter_info_v1 *info, size_t count)

Unregister a batch of meters and their telemetry metric sources.

Parameters
infopointer to array of meter definitions
countarray size

Enumeration Type Documentation

◆ MeterNotifyType

Enumerator
METER_ADDED 
METER_REMOVED 
METER_UPDATE 

◆ MetricNumType

Enumerator
METRIC_INTEGER 
METRIC_DOUBLE 

◆ MetricOTELType

Enumerator
ASYNC_COUNTER 
ASYNC_UPDOWN_COUNTER 
ASYNC_GAUGE_COUNTER 

Variable Documentation

◆ MAX_METER_DESCRIPTION_LEN

constexpr size_t MAX_METER_DESCRIPTION_LEN = 1023
constexpr

◆ MAX_METER_NAME_LEN

constexpr size_t MAX_METER_NAME_LEN = 63
constexpr

◆ MAX_METRIC_DESCRIPTION_LEN

constexpr size_t MAX_METRIC_DESCRIPTION_LEN = 1023
constexpr

◆ MAX_METRIC_NAME_LEN

constexpr size_t MAX_METRIC_NAME_LEN = 63
constexpr

◆ MAX_METRIC_UNIT_LEN

constexpr size_t MAX_METRIC_UNIT_LEN = 63
constexpr