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

metrics

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package metrics holds the rules for the metrics a mod declares in its manifest: which declarations a build may carry, which labels a call may name, and how each kind combines the values added to it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(manifest *wasm.Manifest, name string) *wasm.Metric

Find returns the metric named name that manifest declares, or nil.

func Labeled

func Labeled(metric *wasm.Metric, label string) bool

Labeled reports whether a call may label metric with label: one of its labels, or empty for a metric without labels.

func Validate

func Validate(manifest *wasm.Manifest) error

Validate checks the metrics manifest declares.

Types

type Tally

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

Tally keeps one player's totals of one mod's metrics.

func (*Tally) Add

func (t *Tally) Add(metric *wasm.Metric, label string, value float64)

Add adds value to metric's total under label.

func (*Tally) Text

func (t *Tally) Text() string

Text describes the totals in one line, such as "hud.opened[compact] 3".

func (*Tally) Totals

func (t *Tally) Totals() *wasm.MetricTotals

Totals returns the totals in name and label order.

Jump to

Keyboard shortcuts

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