Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetFightThreshold ¶
func SetFightThreshold(updatesPerMinute float64)
SetFightThreshold updates the maximum allowed rate of updates to a resource per minute before we begin logging errors to the user.
Types ¶
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector uses a linear differential equation to estimate the frequency of updates to resources, then logs to klog.Warning when it detects resources needing updates too frequently.
Instantiate with NewDetector().
Performance characteristics:
- Current implementation is threadsafe.
- Current implementation has unbounded memory usage on the order of the number of objects the Syncer updates through its lifetime.
- Updating an already-tracked resource requires no memory allocations and take approximately 30ns, ignoring logging time.
func (*Detector) DetectFight ¶
DetectFight detects whether the resource is needing updates too frequently. If so, it increments the resource_fights metric and logs to klog.Error.
Click to show internal directories.
Click to hide internal directories.