metrics

package
v3.1.32 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	NormalizePath: true,
	MaxAge:        5 * time.Minute,
	MaxSize:       10000,
}

Functions

func Mount

func Mount(app *core.Core, path string, m *Metrics)

Types

type Config

type Config struct {
	NormalizePath bool
	MaxAge        time.Duration // 超过此时间的记录将被清理,0 表示不清理
	MaxSize       int           // 最大记录数,超出时清空旧记录,0 表示不限制
}

type Metrics

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

func New

func New(conf ...Config) (*Metrics, core.HandlerFunc)

func (*Metrics) Handler

func (m *Metrics) Handler() core.HandlerFunc

func (*Metrics) Middleware

func (m *Metrics) Middleware() core.HandlerFunc

func (*Metrics) RenderPrometheus

func (m *Metrics) RenderPrometheus() string

Jump to

Keyboard shortcuts

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