MySQL 9.1.0
Source Code Documentation
|
This service is named pfs_metrics_v1 and it exposes the following methods:
register_meters
: register a batch of meters (metric groups), each with its own metric setunregister_meters
: unregister a batch of metersregister_change_notification
: metric component to register a callback function to be notified of the changes related to meter statusunregister_change_notification
: unregister change notification callbacksend_change_notification
: helper to trigger exact change notification (if callback registered)Metric sources are grouped into metric groups (meters) to follow the Open Telemetry model.
Register/unregister methods accept an array of PSI_meter_info_v1 structures, each describing a single meter using fields:
Metrics array consists of PSI_metric_info_v1 structures, describing a metric using fields:
The following Open Telemetry metric types are supported:
Metric sources can be registered by:
Meter/metric definition arrays must exist for as long as the matching meters/metrics are being registered, the internal code keeps pointers to this registration data.
Measurement callback method accepts a function pointer parameter (delivery callback) and uses it to report one or more measurement values for a given metric (with optional key/value attributes attached to each).
Following diagram shows the block diagram of PFS services functionality, exposed via mysql-server component. Interface usage here is done from the point of view of an entity that exposes metric sources.
The next diagram shows the functionality used from the point of view of the component that will export the metric measurements, and installs its notification callback to track changes in available metrics.