prom

package
v0.3.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPMiddleware

func HTTPMiddleware(next http.Handler) http.Handler

HTTPMiddleware http connection metric reader

func IPCMiddleware

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

IPCMiddleware unix-socket connection counter

func Init

func Init()

Init module initialization

func RegisterDBCollector

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

RegisterDBCollector create metric colletor for given connection

func Serve

func Serve(addr string) *http.Server

Serve start listening http

func WSMiddleware

func WSMiddleware(next http.Handler) http.Handler

WSMiddleware websocket connection counter

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