package metrics
import "zgo.at/goatcounter/v2/metrics"
Package metrics collects performance metrics.
Index ¶
Types ¶
type Metric ¶
type Metric struct {
// contains filtered or unexported fields
}
Metric is a single metric that's being recorded.
func Start ¶
Start recording performance metrics with the given tag.
func (*Metric) AddTag ¶
AddTag adds another part to this metric's tag, for example:
m := Start("hello") defer m.Done() if isCached { m.AddTag("cached") return cachedItem }
This will record the cached entries as "hello.cached", separate from the regular "hello" entries.
func (*Metric) Done ¶
func (t *Metric) Done()
Done finishes recording this performance metrics, and actually records it.
type Metrics ¶
func List ¶
func List() Metrics
List metrics, sorted by name.
func (Metrics) Sort ¶
Sort returns a copy sorted by the given metric.
Source Files ¶
metrics.go
- Version
- v2.5.0 (latest)
- Published
- Dec 14, 2023
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 day ago –
Tools for package owners.