metrics

package
v0.0.0-...-658fa7e Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Counter 定义 CounterVec 指标采集器
	Counter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "http_request_total",
			Help: "The total number of HTTP requests",
		},
		[]string{"uri"},
	)
	// Summary 定义Summary指标采集器
	Summary = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Name:       "http_request_delay",
			Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
		},
		[]string{"uri"},
	)
)

Functions

func DelayMiddleware

func DelayMiddleware() middleware.Middleware

DelayMiddleware 记录请求时长

func QPSMiddleware

func QPSMiddleware() middleware.Middleware

QPSMiddleware 记录QPS

Types

This section is empty.

Jump to

Keyboard shortcuts

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