database

package
v0.0.0-...-6ee8545 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMetric

func GetMetric(name string) (prometheus.Metric, error)

GetMetric returns the metric whose Description best matches the supplied name.

func NewEngine

func NewEngine(ctx context.Context, conn pgxconn.PgxConn) *metricsEngineImpl

NewEngine creates an engine that performs database metrics evaluation every evalInterval. The engine runs predefined queries that returns a BIGINT as the metric value which is then set as a value to Prometheus metric.

Note: Make sure to call this only when the database is TimescaleDB. Plain Postgres will cause evaluation errors.

Types

type Engine

type Engine interface {
	Run() error
	IsRunning() bool
}

Jump to

Keyboard shortcuts

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