metrics

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2021 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SG

type SG struct {
	DBName string
	Stats  StatsGetter
}

SG - StatsGetter Attributes

type StatsCollector

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

StatsCollector implements the prometheus.Collector interface.

func NewStatsCollector

func NewStatsCollector(dbName string, sg StatsGetter) *StatsCollector

NewStatsCollector creates a new StatsCollector.

func (*StatsCollector) AddStatsGetter

func (sc *StatsCollector) AddStatsGetter(dbName string, sg StatsGetter)

AddStatsGetter - Add a new db name and stats getter pair which will be reported on

func (StatsCollector) Collect

func (sc StatsCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (StatsCollector) Describe

func (sc StatsCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface.

type StatsGetter

type StatsGetter interface {
	Stats() sql.DBStats
}

StatsGetter is an interface that gets sql.DBStats. It's implemented by e.g. *sql.DB or *sqlx.DB.

Jump to

Keyboard shortcuts

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