metrics

package
v0.0.0-...-beee1d2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelNameAddr       = "addr"
	LabelNameAlias      = "alias"
	LabelInstanceMode   = "instance-mode"
	LabelConsensusLevel = "consensus-level"
	LabelID             = "proxy_id"
	LabelProductName    = "product_name"
	LabelOpstr          = "opstr"
)
View Source
const TimeLayout = "2006-01-02 15:04:05"

Variables

View Source
var MetricConfigs = make(map[string]MetricConfig)
View Source
var MetricConfigsProxy = make(map[string]MetricConfig)

Functions

func Register

func Register(mcs map[string]MetricConfig)

func RegisterBinlog

func RegisterBinlog()

func RegisterCPU

func RegisterCPU()

func RegisterCache

func RegisterCache()

func RegisterClients

func RegisterClients()

func RegisterCommandExecCount

func RegisterCommandExecCount()

func RegisterCommandstats

func RegisterCommandstats()

func RegisterData

func RegisterData()

func RegisterForProxy

func RegisterForProxy()

func RegisterKeyspace

func RegisterKeyspace()

func RegisterProxy

func RegisterProxy(mcs map[string]MetricConfig)

func RegisterReplication

func RegisterReplication()

func RegisterRocksDB

func RegisterRocksDB()

func RegisterServer

func RegisterServer()

func RegisterStats

func RegisterStats()

func StructToMap

func StructToMap(obj interface{}) (map[string]string, map[string][]int64, error)

Types

type CollectFunc

type CollectFunc func(metric Metric) error

func (CollectFunc) Collect

func (c CollectFunc) Collect(metric Metric) error

type Collector

type Collector interface {
	Collect(metric Metric) error
}

type DescribeFunc

type DescribeFunc func(m MetaData)

func (DescribeFunc) Describe

func (d DescribeFunc) Describe(m MetaData)

type Describer

type Describer interface {
	Describe(data MetaData)
}

type Matcher

type Matcher interface {
	Match(v string) bool
}

type MetaData

type MetaData struct {
	Name      string
	Help      string
	Type      string
	Labels    []string
	ValueName string
}

func (MetaData) Desc

func (m MetaData) Desc(d Describer)

func (MetaData) Lookup

func (m MetaData) Lookup(f func(m MetaData))

func (MetaData) MetricsType

func (m MetaData) MetricsType() prometheus.ValueType

type MetaDatas

type MetaDatas []MetaData

func (MetaDatas) Desc

func (ms MetaDatas) Desc(d Describer)

func (MetaDatas) Lookup

func (ms MetaDatas) Lookup(f func(m MetaData))

type Metric

type Metric struct {
	MetaData
	LabelValues []string
	Value       float64
}

type MetricConfig

type MetricConfig struct {
	Parser
	MetricMeta
}

type MetricMeta

type MetricMeta interface {
	Desc(d Describer)
	Lookup(func(m MetaData))
}

type ParseOption

type ParseOption struct {
	Version       *semver.Version
	Extracts      map[string]string
	ExtractsProxy map[string][]int64
	Info          string
}

type Parser

type Parser interface {
	Parse(m MetricMeta, c Collector, opt ParseOption)
}

type Parsers

type Parsers []Parser

func (Parsers) Parse

func (ps Parsers) Parse(m MetricMeta, c Collector, opt ParseOption)

Jump to

Keyboard shortcuts

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