timing

package
v1.28.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRun = NewTimedRun()

DefaultRun is the default "singleton" TimedRun instance.

Functions

func Enabled added in v1.28.2

func Enabled() bool

func JSON

func JSON() (string, error)

func SetTracer added in v1.28.2

func SetTracer(ctx context.Context, t trace.Tracer)

Types

type TimedRun

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

TimedRun provides a running store of how long is spent in each category.

func NewTimedRun

func NewTimedRun() *TimedRun

NewTimedRun returns an initialized TimedRun instance.

func (*TimedRun) JSON

func (tr *TimedRun) JSON() (string, error)

func (*TimedRun) Stop

func (tr *TimedRun) Stop(t *Timer)

Stop stops the specified timer and increments the time spent in that category.

type Timer

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

Timer represents a running timer.

func Start

func Start(category string) *Timer

Start starts a new Timer and returns it.

func (*Timer) SetAttributes added in v1.28.2

func (t *Timer) SetAttributes(kv ...attribute.KeyValue)

Jump to

Keyboard shortcuts

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