Allow to collect power 48/74648/1
authorLuc Provoost <luc.provoost@gmail.com>
Mon, 11 Nov 2024 14:26:51 +0000 (15:26 +0100)
committerLuc Provoost <luc.provoost@gmail.com>
Mon, 11 Nov 2024 14:26:51 +0000 (15:26 +0100)
In order to collect pwoer of the system under test, one can now define a
power helper function that will retrieve System, CPU, and RAM power. This
function will then be called at the end of a test iteration. The actual
function to collect the power is not provided in this github.

Signed-off-by: Luc Provoost <luc.provoost@gmail.com>
Change-Id: Ic33881326f9318f1669fdef69a872596cc8e6dbc

VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py

index deba695..37540b2 100644 (file)
@@ -357,6 +357,10 @@ class RapidTest(object):
                         time_loop_data['Size'] = size
                         time_loop_data['RequestedSpeed'] = RapidTest.get_pps(speed, size)
                         _ = self.post_data(time_loop_data)
+            if 'power_helper' in self.test.keys():
+                iteration_data['Sys'],iteration_data['Cpu'],iteration_data['Ram'] = self.test['power_helper'].get_power()
+            else:
+                iteration_data['Sys'],iteration_data['Cpu'],iteration_data['Ram'] = 0,0,0
             end_bg_gen_stats = []
             for bg_gen_machine in self.background_machines:
                 bg_rx, bg_non_dp_rx, bg_tx, bg_non_dp_tx, _, _, bg_tsc, bg_hz = bg_gen_machine.core_stats()