metrics

package
v0.27.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: GPL-3.0 Imports: 7 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) *GateMetrics

NewGateMetrics creates new metrics for http gate.

func (*GateMetrics) Collect

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

func (*GateMetrics) Describe

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

func (GateMetrics) SetHealth

func (m GateMetrics) SetHealth(s HealthStatus)

func (*GateMetrics) Unregister

func (g *GateMetrics) Unregister()

type HealthStatus

type HealthStatus int32

HealthStatus of the gate application.

const (
	HealthStatusUndefined    HealthStatus = 0
	HealthStatusStarting     HealthStatus = 1
	HealthStatusReady        HealthStatus = 2
	HealthStatusShuttingDown HealthStatus = 3
)

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