metrics

package
v9.9.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gatherer

type Gatherer interface {
	DatabaseMetadata() (globalStatus map[string]string, globalVariables map[string]string, err error)
	FollowerMetadata() (slaveStatus map[string]string, heartbeatStatus map[string]string, err error)
	IsDatabaseFollower() (bool, error)
	IsDatabaseAvailable() bool
	DiskStats() (map[string]string, error)
	BrokerStats() (map[string]string, error)
	CPUStats() (map[string]string, error)
}

type Logger

type Logger interface {
	Debug(string, map[string]interface{})
	Error(string, error)
}

type LoggregatorSender

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

func NewLoggregatorSender

func NewLoggregatorSender(client *loggregator.IngressClient, sourceID string) *LoggregatorSender

func (*LoggregatorSender) SendValue

func (sender *LoggregatorSender) SendValue(name string, value float64, unit string) error

type Metric

type Metric struct {
	Key      string  `json:"key"`
	Value    float64 `json:"value"`
	Unit     string  `json:"unit"`
	RawValue string
	Error    error
}

type MetricDefinition

type MetricDefinition struct {
	Key  string `yaml:"key"`
	Unit string `yaml:"unit"`
}

type MetricMappingConfig

type MetricMappingConfig struct {
	MysqlMetricMappings          map[string]MetricDefinition
	GaleraMetricMappings         map[string]MetricDefinition
	LeaderFollowerMetricMappings map[string]MetricDefinition
	DiskMetricMappings           map[string]MetricDefinition
	BrokerMetricMappings         map[string]MetricDefinition
	CPUMetricMappings            map[string]MetricDefinition
}

func DefaultMetricMappingConfig

func DefaultMetricMappingConfig() *MetricMappingConfig

type MetricWriter

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

func NewMetricWriter

func NewMetricWriter(sender Sender, logger Logger, origin string) *MetricWriter

func (*MetricWriter) Write

func (writer *MetricWriter) Write(metrics []*Metric) error

type MetricsComputer

type MetricsComputer interface {
	ComputeAvailabilityMetric(bool) *Metric
	ComputeIsFollowerMetric(bool) *Metric
	ComputeGlobalMetrics(map[string]string) []*Metric
	ComputeLeaderFollowerMetrics(map[string]string) []*Metric
	ComputeDiskMetrics(map[string]string) []*Metric
	ComputeBrokerMetrics(map[string]string) []*Metric
	ComputeGaleraMetrics(map[string]string) []*Metric
	ComputeCPUMetrics(map[string]string) []*Metric
}

type Processor

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

func NewProcessor

func NewProcessor(
	gatherer Gatherer,
	metricsComputer MetricsComputer,
	metricsWriter Writer,
	configuration *config.Config,
) Processor

func (Processor) Process

func (p Processor) Process() error

type Sender

type Sender interface {
	SendValue(name string, value float64, unit string) error
}

type Writer

type Writer interface {
	Write(metric []*Metric) error
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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