prom

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RANGES_QUEUED        = "ranges_queued"
	LOADED_HEIGHT        = "loaded_height"
	PROCESSED_HEIGHT     = "processed_height"
	T_BLOCK_LOAD         = "t_block_load"
	T_BLOCK_PROCESSING   = "t_block_processing"
	T_STATE_PROCESSING   = "t_state_processing"
	T_POSTGRES_TX_COMMIT = "t_postgres_tx_commit"
)

Variables

This section is empty.

Functions

func DecQueuedRanges added in v0.2.6

func DecQueuedRanges()

DecQueuedRanges decrements the number of queued range requests

func HTTPMiddleware added in v0.2.6

func HTTPMiddleware(next http.Handler) http.Handler

HTTPMiddleware http connection metric reader

func IPCMiddleware added in v0.2.6

func IPCMiddleware(server *rpc.Server, client rpc.Conn)

IPCMiddleware unix-socket connection counter

func IncQueuedRanges added in v0.2.6

func IncQueuedRanges()

IncQueuedRanges increments the number of queued range requests

func Init

func Init()

Init module initialization

func Listen

func Listen(addr string) *http.Server

Listen start listening http

func RegisterDBCollector

func RegisterDBCollector(name string, db *sqlx.DB)

RegisterDBCollector create metric collector for given connection

func SetLastLoadedHeight

func SetLastLoadedHeight(height int64)

SetLastLoadedHeight sets last loaded height

func SetLastProcessedHeight

func SetLastProcessedHeight(height int64)

SetLastProcessedHeight sets last processed height

func SetTimeMetric

func SetTimeMetric(name string, t time.Duration)

SetTimeMetric time metric observation

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