metric

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package metric provides utilities for tracking the performance of an application.

Functions in this package should only be used from the main thread.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginFrame

func BeginFrame()

BeginFrame starts a new frame. This should be called at the beginning of each game frame.

func EndFrame

func EndFrame()

EndFrame ends the current frame.

Types

type Region

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

Region represents a monitoring region and is using during profiling.

func BeginRegion

func BeginRegion(name string) *Region

BeginRegion starts a new monitoring region. The region must be ended with a call to End.

func (*Region) End

func (r *Region) End()

End ends the current region.

type Span

type Span struct {
	Name     string
	Children []Span
	Duration time.Duration
}

Span represents a span in a flame graph. Unlike a region, it represents a summary of the overall time spent in a region.

func FrameTree

func FrameTree() (Span, int)

FlameTree returns the current flame graph tree and the number of recorded iterations.

Directories

Path Synopsis
Package metricui provides a user interface for displaying metrics.
Package metricui provides a user interface for displaying metrics.

Jump to

Keyboard shortcuts

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