From 6ef6f12801522888d7e436c0d2bab11de10b74a4 Mon Sep 17 00:00:00 2001 From: MohammedAbdi Date: Thu, 1 Aug 2024 13:26:40 -0400 Subject: [PATCH] print new energy values Signed-off-by: MohammedAbdi --- internal/controller/labelgroup_controller.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/controller/labelgroup_controller.go b/internal/controller/labelgroup_controller.go index e3367e3..3cf4c63 100644 --- a/internal/controller/labelgroup_controller.go +++ b/internal/controller/labelgroup_controller.go @@ -230,9 +230,9 @@ func (r *LabelGroupReconciler) Reconcile(ctx context.Context, req ctrl.Request) // - In the set of new containers, remove all containers that are active for containerId, oldValue := range labelGroup.Status.ActiveContainerIds { if newValue, found := metricValues[containerId]; found { - // totalEnergy += (newValue - oldValue) //put back - r.Logger.V(5).Info(fmt.Sprintf("[Reconcile-Aggregating] oldValue: %#v", oldValue)) - totalEnergy = 100 // testing purpose - remove after + totalEnergy += (newValue - oldValue) + r.Logger.V(5).Info(fmt.Sprintf("[Reconcile-Aggregating] newValue: %#v", newValue)) // trace + r.Logger.V(5).Info(fmt.Sprintf("[Reconcile-Aggregating] oldValue: %#v", oldValue)) // trace labelGroup.Status.ActiveContainerIds[containerId] = newValue delete(metricValues, containerId) } else {