metrics

package
v1.28.6 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearSession

func ClearSession()

ClearSession removes all categories and metrics

Types

type Category

type Category interface {
	Name() string
	Metrics() []Metric
}

func Debug

func Debug() []Category

Debug returns debug metrics that were recording during this session

func General

func General() []Category

General returns general metrics that were recording during this session

type CounterMetric

type CounterMetric interface {
	Metric
	Increment(delta int)
}

func Counter

func Counter(category, name string) CounterMetric

Counter creates a new counter metric (or returns an existing one if one already exists with this name and category)

func DebugCounter

func DebugCounter(category, name string) CounterMetric

DebugCounter creates a new debug counter metric (or returns an existing one if one already exists with this name and category)

type Metric

type Metric interface {
	Name() string
	Value() string
}

type TimerMetric

type TimerMetric interface {
	Metric
	Start()
	Stop()
}

func DebugTimer

func DebugTimer(category, name string) TimerMetric

DebugTimer returns a new debug timer (or returns an existing one if one exists with this category and name)

func Timer

func Timer(category, name string) TimerMetric

Timer returns a new timer (or returns an existing one if one exists with this category and name)

Jump to

Keyboard shortcuts

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