metrics

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address string
	Enabled bool
}

Config is a params to configure service.

type GateMetrics

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

func NewGateMetrics

func NewGateMetrics(p *pool.Pool, statistic *stat.PoolStat) *GateMetrics

NewGateMetrics creates new metrics for http gate.

func (*GateMetrics) Collect added in v0.24.0

func (m *GateMetrics) Collect(ch chan<- prometheus.Metric)

func (*GateMetrics) Describe added in v0.24.0

func (m *GateMetrics) Describe(descs chan<- *prometheus.Desc)

func (*GateMetrics) SetGWVersion added in v0.27.0

func (g *GateMetrics) SetGWVersion(ver string)

func (GateMetrics) SetHealth

func (m GateMetrics) SetHealth(s int32)

func (*GateMetrics) Unregister added in v0.25.0

func (g *GateMetrics) Unregister()

type Service

type Service struct {
	*http.Server
	// contains filtered or unexported fields
}

Service serves metrics.

func NewPprofService

func NewPprofService(l *zap.Logger, cfg Config) *Service

NewPprofService creates a new service for gathering pprof metrics.

func NewPrometheusService

func NewPrometheusService(log *zap.Logger, cfg Config) *Service

NewPrometheusService creates a new service for gathering prometheus metrics.

func (*Service) ShutDown

func (ms *Service) ShutDown(ctx context.Context)

ShutDown stops the service.

func (*Service) Start

func (ms *Service) Start()

Start runs http service with the exposed endpoint on the configured port.

Jump to

Keyboard shortcuts

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