Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ThrottledEventListener ¶ added in v1.15.1
type ThrottledEventListener interface {
WhenThrottled()
}
type ThrottledEventRecorder ¶ added in v1.15.1
type ThrottledEventRecorder struct { }
uses the event api to record that video was throttled at a particular time.
func (ThrottledEventRecorder) WhenThrottled ¶ added in v1.15.1
func (er ThrottledEventRecorder) WhenThrottled()
type ThrottledRecorder ¶
type ThrottledRecorder struct {
// contains filtered or unexported fields
}
ThrottledRecorder wraps a standard recorder so that it stops recording (ie gets throttled) if requested to record too often. This is desirable as the extra recordings are likely to be highly similar to the earlier recordings and contain no new information. It can happen when an animal is stuck in a trap or it is very windy.
func NewThrottledRecorder ¶
func NewThrottledRecorder( baseRecorder recorder.Recorder, config *ThrottlerConfig, minSeconds int, eventListener ThrottledEventListener, ) *ThrottledRecorder
func NewThrottledRecorderWithClock ¶ added in v1.20.0
func NewThrottledRecorderWithClock( baseRecorder recorder.Recorder, config *ThrottlerConfig, minSeconds int, listener ThrottledEventListener, clock ratelimit.Clock, ) *ThrottledRecorder
func (*ThrottledRecorder) CheckCanRecord ¶
func (throttler *ThrottledRecorder) CheckCanRecord() error
func (*ThrottledRecorder) StartRecording ¶
func (throttler *ThrottledRecorder) StartRecording() error
func (*ThrottledRecorder) StopRecording ¶
func (throttler *ThrottledRecorder) StopRecording() error
func (*ThrottledRecorder) WriteFrame ¶
func (throttler *ThrottledRecorder) WriteFrame(frame *lepton3.Frame) error
type ThrottlerConfig ¶
type ThrottlerConfig struct { ApplyThrottling bool `yaml:"apply-throttling"` BucketSize time.Duration `yaml:"bucket-size"` MinRefill time.Duration `yaml:"min-refill"` }
func DefaultThrottlerConfig ¶
func DefaultThrottlerConfig() ThrottlerConfig
Click to show internal directories.
Click to hide internal directories.