prom

package
v0.0.0-...-a7f4e4d Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

func RegisterDBCollector

func RegisterDBCollector(name string, db DBStatsGetter)

RegisterDBCollector create metric collector for given connection

func Serve

func Serve(addr string) *http.Server

Serve start listening http

func SetLastValidatedBlock

func SetLastValidatedBlock(blockNumber float64)

SetLastValidatedBlock sets the last validated block number

Types

type DBStatsCollector

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

DBStatsCollector implements the prometheus.Collector interface.

func NewDBStatsCollector

func NewDBStatsCollector(dbName string, sg DBStatsGetter) *DBStatsCollector

NewDBStatsCollector creates a new DBStatsCollector.

func (DBStatsCollector) Collect

func (c DBStatsCollector) Collect(ch chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (DBStatsCollector) Describe

func (c DBStatsCollector) Describe(ch chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface.

type DBStatsGetter

type DBStatsGetter interface {
	Stats() sql.DBStats
}

DBStatsGetter is an interface that gets sql.DBStats.

Jump to

Keyboard shortcuts

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