Increase threshold for small time errors from 10 microseconds to 1 millisecond.

PiperOrigin-RevId: 602878001
This commit is contained in:
gVisor bot
2024-01-30 16:50:06 -08:00
parent 80af63b5e3
commit ca8ab5d17b
+2 -7
View File
@@ -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)
}