moved energy metric monitoring to another function updateEnergyMetrics