Documentation
¶
Overview ¶
Package metrics tracks runtime signals about the docker sandbox.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerStats ¶
type ContainerStats struct {
Count int
OldestAge time.Duration
LastPoll time.Time
LastError string
}
ContainerStats is a point-in-time snapshot of sandbox container counts.
type ContainerWatcher ¶
type ContainerWatcher struct {
// contains filtered or unexported fields
}
ContainerWatcher periodically inspects running gotutor-* docker containers and exposes the count and oldest age. The intent is to detect leaks: per request the controller already tries hard to kill its container (Cancel callback + deferred docker kill + --rm). Counts that grow past the concurrency cap, or ages past the per-request docker timeout, mean those safeguards have failed and the daemon is accumulating dead work.
func NewContainerWatcher ¶
func NewContainerWatcher(logger zerolog.Logger) *ContainerWatcher
NewContainerWatcher returns a watcher; call Start to begin polling.
func (*ContainerWatcher) Start ¶
func (w *ContainerWatcher) Start(ctx context.Context)
Start launches the polling goroutine. It runs until ctx is cancelled.
func (*ContainerWatcher) Stats ¶
func (w *ContainerWatcher) Stats() ContainerStats
Stats returns the latest snapshot. Safe to call from any goroutine.