util/clientmetric: add test hooks and ResetLastDelta function
Necessary to force flushing of client metrics more aggressively in
dev/test mode.
@@ -255,6 +255,10 @@ func EncodeLogTailMetricsDelta() string {
return enc.buf.String()
}
+func ResetLastDeltaForTest() {
+ lastDelta = time.Time{}
+}
+
var deltaPool = &sync.Pool{
New: func() any {
return new(deltaEncBuf)
