metrics

package
v0.0.0-...-1ce29ab Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2022 License: Unlicense Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ErrDescriptionCtxKey = ContextKey("errDescription")

Variables

This section is empty.

Functions

func NewPromMiddleware

func NewPromMiddleware(host string) func(next http.Handler) http.Handler

Types

type ConnectionStat

type ConnectionStat interface{}

type ContextKey

type ContextKey string

func (ContextKey) String

func (c ContextKey) String() string

type DBClient

type DBClient struct {
	Connections  prometheus.GaugeFunc
	ErrsTotal    *prometheus.CounterVec
	TimeTotal    *prometheus.CounterVec
	BytesTotal   *prometheus.CounterVec
	RecordsTotal *prometheus.CounterVec
}

func NewDBClient

func NewDBClient(db, host, port string, fn func() float64) *DBClient

func (*DBClient) AutoRegister

func (c *DBClient) AutoRegister() *DBClient

type HTTPIn

type HTTPIn struct {
	Uptime          prometheus.GaugeFunc
	ReqTotal        *prometheus.CounterVec
	ReqBytesTotal   *prometheus.CounterVec
	ReqErrorsTotal  *prometheus.CounterVec
	RespTotal       *prometheus.CounterVec
	RespBytesTotal  *prometheus.CounterVec
	RespErrorsTotal *prometheus.CounterVec
	RespTimeHist    *prometheus.HistogramVec
	RespTimeTotal   *prometheus.GaugeVec
}

func NewHTTPIn

func NewHTTPIn(host, ip, port string) *HTTPIn

func (*HTTPIn) AutoRegister

func (h *HTTPIn) AutoRegister() *HTTPIn

type HTTPOut

type HTTPOut struct {
	DNSResolveTime      *prometheus.GaugeVec
	ConnectTime         *prometheus.CounterVec
	HandshakeTime       *prometheus.CounterVec
	ReqTotal            *prometheus.CounterVec
	ReqBytesTotal       *prometheus.CounterVec
	ReqErrorsTotal      *prometheus.CounterVec
	RespTotal           *prometheus.CounterVec
	RespBytesTotal      *prometheus.CounterVec
	RespErrorsTotal     *prometheus.CounterVec
	RespTimeToFirstByte *prometheus.GaugeVec
	RespTimeTotal       *prometheus.CounterVec
}

func NewHTTPOut

func NewHTTPOut(host string) *HTTPOut

func (*HTTPOut) AutoRegister

func (h *HTTPOut) AutoRegister() *HTTPOut

func (*HTTPOut) DoAndCollect

func (h *HTTPOut) DoAndCollect(c *http.Client, req *http.Request, dest interface{}) (*http.Response, error)

Jump to

Keyboard shortcuts

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