mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Increase threshold for small time errors from 10 microseconds to 1 millisecond.
PiperOrigin-RevId: 602878001
This commit is contained in:
@@ -229,15 +229,10 @@ func errorAdjust(prevParams Parameters, newParams Parameters, now TSCValue) (Par
|
||||
// The log level is determined by the error severity.
|
||||
func logErrorAdjustment(clock ClockID, errorNS ReferenceNS, orig, adjusted Parameters) {
|
||||
magNS := int64(errorNS.Magnitude())
|
||||
if magNS <= 10*time.Microsecond.Nanoseconds() {
|
||||
if magNS <= time.Millisecond.Nanoseconds() {
|
||||
// Don't log small errors.
|
||||
return
|
||||
}
|
||||
fn := log.Infof
|
||||
if magNS > time.Millisecond.Nanoseconds() {
|
||||
// Upgrade large errors to warning.
|
||||
fn = log.Warningf
|
||||
}
|
||||
|
||||
fn("Clock(%v): error: %v ns, adjusted frequency from %v Hz to %v Hz", clock, errorNS, orig.Frequency, adjusted.Frequency)
|
||||
log.Warningf("Clock(%v): error: %v ns, adjusted frequency from %v Hz to %v Hz", clock, errorNS, orig.Frequency, adjusted.Frequency)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user