instrument

package
v3.5.10+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Call

type Call interface {
	// Exec executes a function and records whether it succeeded or
	// failed, and the amount of time that it took.
	Exec(f ExecFn) error
}

Call allows tracking the successes, errors, and timing of functions.

func NewCall

func NewCall(scope tally.Scope, name string) Call

NewCall returns a Call that instruments a function using a given scope and a label to name the metrics. The following counters are created excluding {{ and }}: {{name}}+result_type=success {{name}}+result_type=error The following timers are created excluding {{ and }} and replacing . with the scope's separator: {{name}}.latency

type ExecFn

type ExecFn func() error

ExecFn is an executable function that can be instrumented with a Call.

Jump to

Keyboard shortcuts

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