metrics

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client(opts ...Option) middleware.Middleware

Client 返回一个客户端指标中间件

func Server

func Server(opts ...Option) middleware.Middleware

Server 返回一个服务端指标中间件

Types

type Metrics

type Metrics interface {
	// Counter 计数器
	Counter(name string, value float64, labels map[string]string)
	// Gauge 仪表
	Gauge(name string, value float64, labels map[string]string)
	// Histogram 直方图
	Histogram(name string, value float64, labels map[string]string)
}

Metrics 是指标收集接口

type Option

type Option func(*options)

Option 是指标中间件的选项

func WithMetrics

func WithMetrics(metrics Metrics) Option

WithMetrics 设置指标收集器

Jump to

Keyboard shortcuts

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