metrics

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer(port int, m *Metrics, logger *slog.Logger) *http.Server

StartServer starts the metrics HTTP server. Returns nil if port is 0.

Types

type Metrics

type Metrics struct {
	ActiveSessions atomic.Int64
	TotalSessions  atomic.Int64
	TotalCommands  atomic.Int64
	TotalBytes     atomic.Int64
}

Metrics tracks server statistics.

func (*Metrics) Handler

func (m *Metrics) Handler() http.Handler

Handler returns an HTTP handler that serves JSON metrics at GET /metrics.

Jump to

Keyboard shortcuts

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