package instrument

import "github.com/uber-go/tally/instrument"

Index

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.

Source Files

call.go types.go

Version
v3.5.10+incompatible (latest)
Published
Mar 6, 2024
Platform
linux/amd64
Imports
1 packages
Last checked
2 months ago

Tools for package owners.