debug

package
v0.0.0-...-cdf396f Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package debug provides instrumentation and profiling tools for umd.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpRawMetrics

func DumpRawMetrics(w io.Writer, checks []use.Check)

DumpRawMetrics outputs all collected checks with raw values before threshold evaluation.

func StartPprofServer

func StartPprofServer(addr string) (func(), error)

StartPprofServer starts a pprof HTTP server at the given address. Returns a stop function to gracefully shut down the server.

func TimingReport

func TimingReport(w io.Writer, timings []CollectorTiming)

TimingReport prints a styled timing summary for all timed collectors.

Types

type CollectorTiming

type CollectorTiming struct {
	Name     string
	Duration time.Duration
}

CollectorTiming records the duration of a collector's Collect call.

type TimedCollector

type TimedCollector struct {
	Timing CollectorTiming
	// contains filtered or unexported fields
}

TimedCollector wraps a use.Collector to record collection duration.

func NewTimedCollector

func NewTimedCollector(c use.Collector) *TimedCollector

NewTimedCollector wraps a collector with timing instrumentation.

func (*TimedCollector) Collect

func (t *TimedCollector) Collect(thresholds use.Thresholds) ([]use.Check, error)

Collect runs the wrapped collector and records duration.

func (*TimedCollector) Name

func (t *TimedCollector) Name() string

Name returns the wrapped collector's name.

type TraceLogger

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

TraceLogger provides step-by-step trace logging for collector operations.

func NewTraceLogger

func NewTraceLogger(w io.Writer) *TraceLogger

NewTraceLogger creates a trace logger writing to the given writer.

func (*TraceLogger) Log

func (t *TraceLogger) Log(collector, step, detail string)

Log records a trace entry for a collector step.

func (*TraceLogger) LogValue

func (t *TraceLogger) LogValue(collector, source, rawStr string, parsed float64)

LogValue records a raw value reading from a specific source.

Jump to

Keyboard shortcuts

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