metrics

package
v0.0.0-...-5fbb372 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultTimeout is the default connection timeout used to connect to an InfluxDB instance
	DefaultTimeout = 3 * time.Second
)
View Source
const (

	// MetricsEnabledFlag metrics enable flag
	MetricsEnabledFlag = "metrics"
)

Variables

This section is empty.

Functions

func EnableMetrics

func EnableMetrics()

EnableMetrics enable the metrics service

func InfluxDB

func InfluxDB(r metrics.Registry, d time.Duration, url, database, username, password string)

InfluxDB starts a InfluxDB reporter which will post the metrics from the given registry at each d interval.

func InfluxDBWithTags

func InfluxDBWithTags(r metrics.Registry, d time.Duration, url, database, username, password string, tags map[string]string)

InfluxDBWithTags starts a InfluxDB reporter which will post the metrics from the given registry at each d interval with the specified tags

func NewCounter

func NewCounter(name string) metrics.Counter

NewCounter create a new metrics Counter

func NewGauge

func NewGauge(name string) metrics.Gauge

NewGauge create a new metrics Gauge

func NewHistogramWithUniformSample

func NewHistogramWithUniformSample(name string, reservoirSize int) metrics.Histogram

NewHistogramWithUniformSample create a new metrics History with Uniform Sample algorithm.

func NewMeter

func NewMeter(name string) metrics.Meter

NewMeter create a new metrics Meter

func NewTimer

func NewTimer(name string) metrics.Timer

NewTimer create a new metrics Timer

func Start

func Start(config *config.Config)

Start metrics monitor

func Stop

func Stop()

Stop metrics monitor

Types

type Influxdb

type Influxdb struct {
	Host     string `yaml:"host"`
	Db       string `yaml:"db"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
}

type StatsConfig

type StatsConfig struct {
	EnableMetrics bool `yaml:"enable_metrics"`
	Influxdb      Influxdb
	MetricsTags   map[string]string `yaml:"map,metrics_tags"`
}

func GetStatsConfig

func GetStatsConfig(conf *config.Config) *StatsConfig

Jump to

Keyboard shortcuts

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