Documentation
¶
Overview ¶
Package perftrace is the tracing hook for performance work in this repository. The library code calls Start at interesting points (a gotype operation, a transaction open, an FFI call, a decode). When no tracer is installed, Start costs one atomic load and returns a nil *Span, and every *Span method is a no-op on nil.
Only in-repository test code installs a tracer (see the otelperf package), so library users never see this package or its dependencies. Do not install a tracer for benchmarks: benchmark numbers must not include the cost of tracing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Install ¶
func Install(t Tracer) (uninstall func())
Install makes t the active tracer. The returned function restores the tracer that was active before, unless another Install replaced t since.
func RegisterGauge ¶
func RegisterGauge(g Gauge)
RegisterGauge adds a gauge. Packages call it from init; the tracer reads the list when it is installed. Registration costs nothing at run time.
Types ¶
type Attr ¶
Attr is one span attribute. It has no interface value, so building an Attr does not allocate.
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span is a span handle. A nil *Span is valid and records nothing.
func Start ¶
Start starts a span. With no tracer installed it returns ctx and nil. A nil ctx is treated as context.Background.
type SpanRecorder ¶
SpanRecorder is one recording span of a Tracer.