metrics

package
v2.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: EUPL-1.2, ISC, MIT, + 1 more Imports: 4 Imported by: 0

Documentation

Overview

Package metrics collects performance metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

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

Metric is a single metric that's being recorded.

func Start

func Start(tag string) *Metric

Start recording performance metrics with the given tag.

func (*Metric) AddTag

func (t *Metric) AddTag(tag string)

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

type Metrics []struct {
	Tag   string
	Times ztime.Durations
}

func List

func List() Metrics

Jump to

Keyboard shortcuts

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