Documentation
¶
Overview ¶
Package progress logs bounded status lines for long-running loops, such as workers and pipelines, so operators can see what each one is doing without per-iteration log spam.
A Reporter collects counters between lines. Reporter.Tick logs at most one line per Interval while the loop did work, and at most one per IdleInterval while every counter stayed zero. Lines go to slog's default logger at Info level.
Index ¶
Constants ¶
const ( Interval = 15 * time.Second IdleInterval = time.Minute )
Interval and IdleInterval bound how often a loop logs a status line.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter accumulates named counters for one loop and logs them periodically. It is safe for concurrent use.
func New ¶
New returns a reporter whose lines carry message and attrs. The first line is due one Interval after creation.