metrics

package
v0.0.0-...-94edfc7 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module("metrics", fx.Provide(NewMetrics))

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	Prometheus       *prometheus.Prometheus
	PriceDescs       map[string]*pprom.Desc
	Prices           map[string]float64
	RequestTimeDescs map[string]*pprom.Desc
	RequestTimes     map[string]float64
	BufferTimeDescs  map[string]*pprom.Desc
	BufferTimes      map[string]float64
	ScriptTimeDescs  map[string]*pprom.Desc
	ScriptTimes      map[string]float64
	TotalTimeDescs   map[string]*pprom.Desc
	TotalTimes       map[string]float64
	// contains filtered or unexported fields
}

func NewMetrics

func NewMetrics(params NewMetricsParams, lc fx.Lifecycle) *Metrics

func (*Metrics) AddDescription

func (m *Metrics) AddDescription(r *RegisterScrapeMetricsParams)

func (*Metrics) Collect

func (m *Metrics) Collect(ch chan<- pprom.Metric)

func (*Metrics) Describe

func (m *Metrics) Describe(ch chan<- *pprom.Desc)

func (*Metrics) Record

func (m *Metrics) Record(res *scrape.ScrapeResult)

type NewMetricsParams

type NewMetricsParams struct {
	fx.In

	Prometheus *prometheus.Prometheus
}

type RegisterScrapeMetricsParams

type RegisterScrapeMetricsParams struct {
	Name   string
	Labels map[string]string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳