From 216c53f4e135fd1c51a3fb4eca97afc36d20b8af Mon Sep 17 00:00:00 2001 From: Alp Celik Date: Mon, 9 Dec 2024 14:59:29 +0100 Subject: [PATCH] Change metrics update interval --- cmd/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index fa03b33..e97a18f 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -44,8 +44,9 @@ import ( ) var ( - scheme = runtime.NewScheme() - setupLog = ctrl.Log.WithName("setup") + scheme = runtime.NewScheme() + setupLog = ctrl.Log.WithName("setup") + metricsUpdateInterval = 30 * time.Second ) func init() { //nolint:gochecknoinits // This is required by kubebuilder @@ -195,7 +196,7 @@ func main() { func startMetricsUpdater(ctx context.Context, kubeClient client.Client) { go func() { - ticker := time.NewTicker(15 * time.Second) + ticker := time.NewTicker(metricsUpdateInterval * time.Second) defer ticker.Stop() for range ticker.C { // Update metrics here