From c3f195d322ae32375a648d2855824d8e8eac07f1 Mon Sep 17 00:00:00 2001 From: Ram Lavi Date: Thu, 14 Dec 2023 14:45:36 +0200 Subject: [PATCH] checkup: Add fail logic The checkup will now fail if the oslat Maximum latency measured exceeded the oslatLatencyThreshold, and issue the appropriate failure reason. Signed-off-by: Ram Lavi --- pkg/internal/checkup/checkup.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/internal/checkup/checkup.go b/pkg/internal/checkup/checkup.go index 6a603d0a..82cf7714 100644 --- a/pkg/internal/checkup/checkup.go +++ b/pkg/internal/checkup/checkup.go @@ -95,6 +95,10 @@ func (c *Checkup) Run(ctx context.Context, oslatLatencyThreshold time.Duration) return err } + if c.results.OslatMaxLatency > oslatLatencyThreshold { + return fmt.Errorf("oslat Max Latency measured %s exceeded the given threshold %s", + c.results.OslatMaxLatency.String(), oslatLatencyThreshold.String()) + } return nil }