metric

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HTTPServerReqDuration = NewHistogramVec(&HistogramVecOpts{
		Namespace: _httpServerNamespace,
		Subsystem: "requests",
		Name:      "duration_ms",
		Help:      "http server requests duration(ms).",
		Labels:    []string{"path", "method", "peer"},
		Buckets:   []float64{5, 10, 25, 50, 100, 250, 500, 1000},
	})

	HTTPServerHandleCounter = NewCounterVec(&CounterVecOpts{
		Namespace: _httpServerNamespace,
		Subsystem: "requests",
		Name:      "code_total",
		Help:      "http server requests error count.",
		Labels:    []string{"path", "method", "peer", "code"},
	})
)

http metrics

View Source
var (
	UnaryServerReqDuration = NewHistogramVec(&HistogramVecOpts{
		Namespace: _unaryServerNamespace,
		Subsystem: "requests",
		Name:      "duration_ms",
		Help:      "unary server requests duration(ms).",
		Labels:    []string{"peer", "method"},
		Buckets:   []float64{5, 10, 25, 50, 100, 250, 500, 1000},
	})

	UnaryServerHandleCounter = NewCounterVec(&CounterVecOpts{
		Namespace: _unaryServerNamespace,
		Subsystem: "requests",
		Name:      "code_total",
		Help:      "unary server requests error count.",
		Labels:    []string{"peer", "method", "code"},
	})
)

unary metrics

View Source
var (
	RedisClientReqDuration = NewHistogramVec(&HistogramVecOpts{
		Namespace: _redisClientNamespace,
		Subsystem: "requests",
		Name:      "duration_ms",
		Help:      "redis client requests duration(ms).",
		Labels:    []string{"name", "peer", "command"},
		Buckets:   []float64{5, 10, 25, 50, 100, 250, 500, 1000},
	})

	RedisClientErrCounter = NewCounterVec(&CounterVecOpts{
		Namespace: _redisClientNamespace,
		Subsystem: "requests",
		Name:      "error_total",
		Help:      "redis client requests error count.",
		Labels:    []string{"name", "peer", "command", "error"},
	})

	RedisHitCounter = NewCounterVec(&CounterVecOpts{
		Namespace: _redisClientNamespace,
		Subsystem: "requests",
		Name:      "hits_total",
		Help:      "redis client hits total.",
		Labels:    []string{"name", "peer", "command"},
	})

	RedisMissCounter = NewCounterVec(&CounterVecOpts{
		Namespace: _redisClientNamespace,
		Subsystem: "requests",
		Name:      "misses_total",
		Help:      "redis client misses total.",
		Labels:    []string{"name", "peer", "command"},
	})
)

redis metrics

View Source
var (
	RocketMQClientHandleCounter = NewCounterVec(&CounterVecOpts{
		Namespace: _rocketmqClientNamespace,
		Subsystem: "requests",
		Name:      "code_total",
		Help:      "rocketmq client requests code count.",
		Labels:    []string{"peer", "type", "name", "command", "code"},
	})

	RocketMQClientReqDuration = NewHistogramVec(&HistogramVecOpts{
		Namespace: _rocketmqClientNamespace,
		Subsystem: "requests",
		Name:      "duration_ms",
		Help:      "rocketmq client requests duration(ms).",
		Labels:    []string{"peer", "type", "name", "command"},
		Buckets:   []float64{5, 10, 25, 50, 100, 250, 500, 1000},
	})
)

rocketmq metrics

View Source
var (
	KafkaClientHandleCounter = NewCounterVec(&CounterVecOpts{
		Namespace: _kafkaClientNamespace,
		Subsystem: "requests",
		Name:      "code_total",
		Help:      "kafka client requests code count.",
		Labels:    []string{"peer", "type", "name", "command", "code"},
	})

	KafkaClientReqDuration = NewHistogramVec(&HistogramVecOpts{
		Namespace: _kafkaClientNamespace,
		Subsystem: "requests",
		Name:      "duration_ms",
		Help:      "kafka client requests duration(ms).",
		Labels:    []string{"peer", "type", "name", "command"},
		Buckets:   []float64{5, 10, 25, 50, 100, 250, 500, 1000},
	})
)

kafka metrics

View Source
var (
	MySQLClientReqDuration = NewHistogramVec(&HistogramVecOpts{
		Namespace: _mysqlClientNamespace,
		Subsystem: "requests",
		Name:      "duration_ms",
		Help:      "mysql client requests duration(ms).",
		Labels:    []string{"name", "addr", "command"},
		Buckets:   []float64{5, 10, 25, 50, 100, 250, 500, 1000},
	})
)

mysql metrics

Functions

func NewCounterVec

func NewCounterVec(opt *CounterVecOpts) *counterVec

func NewGaugeVec

func NewGaugeVec(opt *GaugeVecOpts) *gaugeVec

func NewHistogramVec

func NewHistogramVec(opt *HistogramVecOpts) *histogramVec

func RegisterMetric

func RegisterMetric(engine *gin.Engine)

Types

type CounterVecOpts

type CounterVecOpts struct {
	Namespace string
	Subsystem string
	Name      string
	Help      string
	Labels    []string
}

type GaugeVecOpts

type GaugeVecOpts struct {
	Namespace string
	Subsystem string
	Name      string
	Help      string
	Labels    []string
}

type HistogramVecOpts

type HistogramVecOpts struct {
	Namespace string
	Subsystem string
	Name      string
	Help      string
	Labels    []string
	Buckets   []float64
}

Jump to

Keyboard shortcuts

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