mysqlplugin

package
v0.0.0-...-4d420c9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// Name of plugin
	Name = "mysql"
	// Version of plugin
	Version = 4
	// Type of plugin
	Type = plugin.CollectorPluginType
)

Variables

This section is empty.

Functions

func Meta

func Meta() *plugin.PluginMeta

Meta returns plugin's metadata

func NewCollector

func NewCollector(statsSource mysqlSource, useInnodb bool) *metricCollector

NewCollector constructs new metricCollector that will query given statsSource. useInnodb indicates if innodb statistics are gathered (and gathering will fail if they are unavailable).

Types

type MySQLPlugin

type MySQLPlugin struct {
	// contains filtered or unexported fields
}

MySQLPlugin is implementation of plugin.Plugin interface.

func New

func New() *MySQLPlugin

New returns initialized instance of MySQL Plugin collector

func (*MySQLPlugin) CollectMetrics

func (p *MySQLPlugin) CollectMetrics(mts []plugin.MetricType) ([]plugin.MetricType, error)

CollectMetrics finds required request ids required to collect given metrics, asks collector service for metrics associated with these calls and returns requested metrics. Error is returned when metric collection failed or plugin initialization was unsuccessful.

func (*MySQLPlugin) GetConfigPolicy

func (p *MySQLPlugin) GetConfigPolicy() (*cpolicy.ConfigPolicy, error)

GetConfigPolicy returns plugin config policy

func (*MySQLPlugin) GetMetricTypes

func (p *MySQLPlugin) GetMetricTypes(cfg plugin.ConfigType) ([]plugin.MetricType, error)

GetMetricTypes returns list of available metrics. If initialization failed error is returned.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL