metrics

package
v0.0.0-...-25da3cc Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelNodeStart          = "NodeStart"
	LabelStartTheWorld      = "StartTheWorld"
	LabelStopTheWorld       = "StopTheWorld"
	LabelTaskExec           = "TaskExec"
	LabelLeaderChange       = "LeaderChange"
	LabelLeaderChangeFailed = "LeaderChangeFailed"
	LabelWorkerNodeOffline  = "WorkerNodeOffline"
	LabelRegistryOnline     = "RegistryOnline"
	LabelRegistryOffline    = "RegistryOffline"
)

Variables

This section is empty.

Functions

func GetAllCountInfo

func GetAllCountInfo() map[string]int64

GetAllCountInfo get all counter's count for map[string]int64

Types

type Counter

type Counter interface {
	StartTime() time.Time
	Clear()
	Count() int64
	Dec()
	Inc()
	Add(int64)
}

Counter incremented and decremented base on int64 value.

func NewCounter

func NewCounter() Counter

NewCounter constructs a new StandardCounter.

type Metrics

type Metrics interface {
	GetStandardCounter(label string) Counter
	Inc(label string)
	Dec(label string)
	Add(label string, value int64)
}

func Default

func Default() Metrics

func NewMetrics

func NewMetrics() Metrics

type Opts

type Opts struct {
	// Namespace, Subsystem, and Name are components of the fully-qualified
	// name of the Metric (created by joining these components with
	// "_").
	Namespace string
	Subsystem string
	Name      string
}

type StandardMetrics

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

func (*StandardMetrics) Add

func (m *StandardMetrics) Add(label string, value int64)

Add increments the counter by the given value.

func (*StandardMetrics) Dec

func (m *StandardMetrics) Dec(label string)

Dec decrements the counter by 1.

func (*StandardMetrics) GetStandardCounter

func (m *StandardMetrics) GetStandardCounter(label string) Counter

GetCounter get Counter by key

func (*StandardMetrics) Inc

func (m *StandardMetrics) Inc(label string)

Inc increments the counter by 1.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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