api

package
v0.0.0-...-eadbecb Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultStatsPort = 7418

Variables

View Source
var DefaultStatsHandler = &prometheus.Handler{}

Functions

func NewMetricsServer

func NewMetricsServer(h *prometheus.Handler, port int, eng *stats.Engine) *metrics.Server

func NewStatsEngine

func NewStatsEngine(prefix string, tags ...stats.Tag) *stats.Engine

Types

type Metrics

type Metrics struct {
	Config        *MetricsConfig
	StatsHandler  *prometheus.Handler
	MetricsSvr    *metrics.Server
	MetricsEngine *stats.Engine
}

func NewDefaultMetrics

func NewDefaultMetrics() *Metrics

func NewMetrics

func NewMetrics(port int, h *prometheus.Handler, eng *stats.Engine) *Metrics

func (*Metrics) Close

func (m *Metrics) Close() error

func (*Metrics) Flush

func (m *Metrics) Flush()

func (*Metrics) Run

func (m *Metrics) Run() error

func (*Metrics) WithTags

func (m *Metrics) WithTags(tags []stats.Tag) *Metrics

type MetricsConfig

type MetricsConfig struct {
	Prefix    string `json:"prefix"`
	StatsPort int    `json:"stats_port"`
}

Jump to

Keyboard shortcuts

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