metric

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CounterVec

type CounterVec interface {
	Inc(labels ...string)            // Inc 增加1标签
	Add(v float64, labels ...string) // Add 添加任意值标签
}

CounterVec 计数向量重写了 prometheus.CounterVec

func NewCounterVec

func NewCounterVec(cfg *CounterVecOpts) CounterVec

NewCounterVec 封装 prometheus.NewCounterVec 为了增加 labels 参数

type CounterVecOpts

type CounterVecOpts VectorOpts // CounterVecOpts 计数选项

type GaugeVec

type GaugeVec interface {
	Set(v float64, labels ...string) // Set 设置标签
	Inc(labels ...string)            // Inc 增加1标签
	Dec(labels ...string)            // Dec 减少1标签
	Add(v float64, labels ...string) // Add 添加任意值标签
	Sub(v float64, labels ...string) // Sub 减少任意标签
}

func NewGaugeVec

func NewGaugeVec(cfg *GaugeVecOpts) GaugeVec

NewGaugeVec 封装 prometheus.NewGaugeVec 为了增加 labels 参数

type GaugeVecOpts

type GaugeVecOpts VectorOpts // GaugeVecOpts 指标向量选项

type HistogramVec

type HistogramVec interface {
	// Observe adds observation v to labels.
	Observe(v int64, labels ...string)
}

A HistogramVec interface represents a histogram vector.

func NewHistogramVec

func NewHistogramVec(cfg *HistogramVecOpts) HistogramVec

NewHistogramVec returns a HistogramVec.

type HistogramVecOpts

type HistogramVecOpts struct {
	VectorOpts
	Buckets []float64 //柱状图指标新增桶的概念
}

HistogramVecOpts 柱状图选项

type VectorOpts

type VectorOpts struct {
	Namespace string   // 命名空间
	Subsystem string   // 子系统
	Name      string   // 指标名称
	Help      string   // 指标帮助信息
	Labels    []string // 指标标签
}

VectorOpts 指标选项

Jump to

Keyboard shortcuts

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