From 7966aed1e008936ea0fad6c63bd72461cdc55648 Mon Sep 17 00:00:00 2001 From: Mihai Parparita Date: Fri, 6 May 2022 09:52:48 -0700 Subject: [PATCH] util/clientmetric: add test hooks and ResetLastDelta function Necessary to force flushing of client metrics more aggressively in dev/test mode. Signed-off-by: Mihai Parparita --- util/clientmetric/clientmetric.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/clientmetric/clientmetric.go b/util/clientmetric/clientmetric.go index e31f26aa2..a516ed5c1 100644 --- a/util/clientmetric/clientmetric.go +++ b/util/clientmetric/clientmetric.go @@ -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)