metrics

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMetricsInitRegistryError = fmt.Errorf("metrics: can not init metrics registry")
	ErrMetricsDoNotExist        = fmt.Errorf("metrics: metrics do not exists")
	ErrMetricsIsDuplicated      = fmt.Errorf("metrics: metric is duplicated")
)
View Source
var DefaultTallyBuckets = tally.ValueBuckets{.01, .05, .1, .2, .5, .8, .9, 1, 5, 10, 15, 30, 60, 90, 120}

Functions

func DefaultRegistry

func DefaultRegistry() prometheus.Registerer

默认prometheus.DefaultRegisterer, 没有特殊需要,不用使用NewRegisterer

Types

type Stats

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

func (*Stats) AllCount

func (st *Stats) AllCount() uint64

func (*Stats) HitCount

func (st *Stats) HitCount() uint64

func (*Stats) HitRate

func (st *Stats) HitRate() float64

HitRate returns rate for cache hitting

func (*Stats) IncrAllCount

func (st *Stats) IncrAllCount() uint64

func (*Stats) IncrHitCount

func (st *Stats) IncrHitCount() uint64

type TallyScope

type TallyScope struct {
	Reporter promreporter.Reporter
	Scope    tally.Scope
	Closer   io.Closer
}

metrics 发布器

var DefaultTallyScope *TallyScope

TODO 默认metrics Scope

func NewTallyScope

func NewTallyScope(cfg *config.Metrics) *TallyScope

创建

func (*TallyScope) Destroy

func (t *TallyScope) Destroy() error

进程失败销毁

Jump to

Keyboard shortcuts

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