Help us shape the future of Go! Take the 2026 Go Developer Survey

metrics

package
v1.3.99 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package metrics pkg/dmsg/dmsg/metrics/delta.go c1-net-dmsg

Package metrics pkg/dmsg/dmsg/metrics/empty.go c1-net-dmsg

Package metrics pkg/dmsg/dmsg/metrics/metrics.go c1-net-dmsg

Package metrics pkg/dmsg/dmsg/metrics/victoria_metrics.go c1-net-dmsg

The VictoriaMetrics-backed Metrics impl pulls third_party/VictoriaMetrics (runtime.MemStats fields TinyGo doesn't expose) + pkg/metricsutil, so it is tagged out of the TinyGo build. NewVictoriaMetrics is only constructed by the dmsg SERVER services (dmsgsrv/dmsgdisc), never the client core, which uses the no-op Empty metrics. See docs/design/tinygo-dmsg-client.md.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeltaType

type DeltaType int

DeltaType represents a change in metrics gauge.

const (
	DeltaFailed     DeltaType = 0
	DeltaConnect    DeltaType = 1
	DeltaDisconnect DeltaType = -1
)

Delta types.

type Empty

type Empty struct{}

Empty implements Metrics, but does nothing.

func NewEmpty

func NewEmpty() Empty

NewEmpty constructs new empty metrics.

func (Empty) RecordSession

func (Empty) RecordSession(_ DeltaType)

RecordSession implements `Metrics`.

func (Empty) RecordStream

func (Empty) RecordStream(_ DeltaType)

RecordStream implements `Metrics`.

func (Empty) SetClientsCount

func (Empty) SetClientsCount(_ int64)

SetClientsCount implements `Metrics`.

func (Empty) SetPacketsPerMinute

func (Empty) SetPacketsPerMinute(_ uint64)

SetPacketsPerMinute implements `Metrics`.

func (Empty) SetPacketsPerSecond

func (Empty) SetPacketsPerSecond(_ uint64)

SetPacketsPerSecond implements `Metrics`.

type Metrics

type Metrics interface {
	RecordSession(delta DeltaType)
	RecordStream(delta DeltaType)
	SetClientsCount(val int64)
	SetPacketsPerSecond(val uint64)
	SetPacketsPerMinute(val uint64)
}

Metrics collects metrics for metrics tracking system.

type VictoriaMetrics

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

VictoriaMetrics implements `Metrics` using `VictoriaMetrics`.

func NewVictoriaMetrics

func NewVictoriaMetrics() *VictoriaMetrics

NewVictoriaMetrics returns the Victoria Metrics implementation of Metrics.

func (*VictoriaMetrics) RecordSession

func (m *VictoriaMetrics) RecordSession(delta DeltaType)

RecordSession implements `Metrics`.

func (*VictoriaMetrics) RecordStream

func (m *VictoriaMetrics) RecordStream(delta DeltaType)

RecordStream implements Metrics.

func (*VictoriaMetrics) SetClientsCount

func (m *VictoriaMetrics) SetClientsCount(val int64)

SetClientsCount implements `Metrics`.

func (*VictoriaMetrics) SetPacketsPerMinute

func (m *VictoriaMetrics) SetPacketsPerMinute(val uint64)

SetPacketsPerMinute implements `Metrics`.

func (*VictoriaMetrics) SetPacketsPerSecond

func (m *VictoriaMetrics) SetPacketsPerSecond(val uint64)

SetPacketsPerSecond implements `Metrics`.

Jump to

Keyboard shortcuts

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