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 ¶
DumpRawMetrics outputs all collected checks with raw values before threshold evaluation.
func StartPprofServer ¶
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 ¶
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.