From 21c0aa82293c081053c3a7b0e7ea7b26984fa654 Mon Sep 17 00:00:00 2001 From: vijeyash Date: Fri, 8 Mar 2024 14:36:05 +0530 Subject: [PATCH] testing --- agent/kubviz/k8smetrics_agent.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/agent/kubviz/k8smetrics_agent.go b/agent/kubviz/k8smetrics_agent.go index d5e1e515..30dc10e0 100644 --- a/agent/kubviz/k8smetrics_agent.go +++ b/agent/kubviz/k8smetrics_agent.go @@ -154,12 +154,13 @@ func main() { // err = kubescore.RunKubeScore(clientset, js) // events.LogErr(err) } - - collectAndPublishMetrics() - collectAndPublishMetrics() - collectAndPublishMetrics() - collectAndPublishMetrics() + ticker := time.NewTicker(3 * time.Minute) + defer ticker.Stop() collectAndPublishMetrics() + for range ticker.C { + collectAndPublishMetrics() + } + if cfg.SchedulerEnable { // Assuming "cfg.Schedule" is a boolean indicating whether to schedule or not. scheduler := scheduler.InitScheduler(config, js, *cfg, clientset)