Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewErrorRecordingListWatcher ¶
func NewErrorRecordingListWatcher(recorder Recorder, lw cache.ListerWatcher) cache.ListerWatcher
Types ¶
type Condition ¶
type Condition struct { Level EventLevel Locator string Message string }
type ConditionalSampler ¶
type ConditionalSampler interface {
ConditionWhenFailing(*Condition) SamplerFunc
}
type EventInterval ¶
func (*EventInterval) String ¶
func (i *EventInterval) String() string
type EventIntervals ¶
type EventIntervals []*EventInterval
func (EventIntervals) Len ¶
func (intervals EventIntervals) Len() int
func (EventIntervals) Less ¶
func (intervals EventIntervals) Less(i, j int) bool
func (EventIntervals) Swap ¶
func (intervals EventIntervals) Swap(i, j int)
type Interface ¶
type Interface interface { Events(from, to time.Time) EventIntervals Conditions(from, to time.Time) EventIntervals }
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor records events that have occurred in memory and can also periodically sample results.
func NewMonitor ¶
func NewMonitor() *Monitor
NewMonitor creates a monitor with the default sampling interval.
func Start ¶
Start begins monitoring the cluster referenced by the default kube configuration until context is finished.
func (*Monitor) AddSampler ¶
func (m *Monitor) AddSampler(fn SamplerFunc)
AddSampler adds a sampler function to the list of samplers to run every interval. Conditions discovered this way are recorded with a start and end time if they persist across multiple sampling intervals.
func (*Monitor) Conditions ¶
func (m *Monitor) Conditions(from, to time.Time) EventIntervals
Conditions returns all conditions that were sampled in the interval between from and to. If that does not include a sample interval, no results will be returned. EventIntervals are returned in order of their first sampling. A condition that was only sampled once is returned with from == to. No duplicate conditions are returned unless a sampling interval did not report that value.
func (*Monitor) Events ¶
func (m *Monitor) Events(from, to time.Time) EventIntervals
Events returns all events that occur between from and to, including any sampled conditions that were encountered during that period. EventIntervals are returned in order of their occurrence.
func (*Monitor) Record ¶
Record captures one or more conditions at the current time. All conditions are recorded in monotonic order as Event objects.
func (*Monitor) StartSampling ¶
StartSampling starts sampling every interval until the provided context is done. A sample is captured when the context is closed.
type Options ¶
Options is used to run a monitoring process against the provided server as a command line interaction.
type Recorder ¶
type Recorder interface { Record(conditions ...Condition) AddSampler(fn SamplerFunc) }