diff --git a/config.yml.example b/config.yml.example index 753d0a0a..f7b99e1e 100644 --- a/config.yml.example +++ b/config.yml.example @@ -181,6 +181,9 @@ measurement: ######### The value for memory must be in GB not in GiB # HW_MemAmountGB: 16 # Hardware_Availability_Year: 2011 +######### vhost_ratio is the virtualization degree of the machine. For Bare Metal this is 1. For 1 out of 4 VMs this would be 0.25 etc. +# VHost_Ratio: 1 + #--- END diff --git a/metric_providers/psu/energy/ac/xgboost/machine/provider.py b/metric_providers/psu/energy/ac/xgboost/machine/provider.py index d9613b58..51f418bd 100644 --- a/metric_providers/psu/energy/ac/xgboost/machine/provider.py +++ b/metric_providers/psu/energy/ac/xgboost/machine/provider.py @@ -13,7 +13,7 @@ class PsuEnergyAcXgboostMachineProvider(BaseMetricProvider): def __init__(self, *, resolution, HW_CPUFreq, CPUChips, CPUThreads, TDP, - HW_MemAmountGB, CPUCores=None, Hardware_Availability_Year=None, skip_check=False): + HW_MemAmountGB, CPUCores=None, Hardware_Availability_Year=None, VHost_Ratio=1, skip_check=False): super().__init__( metric_name="psu_energy_ac_xgboost_machine", metrics={"time": int, "value": int}, @@ -29,6 +29,7 @@ def __init__(self, *, resolution, HW_CPUFreq, CPUChips, CPUThreads, TDP, self.HW_MemAmountGB = HW_MemAmountGB self.CPUCores = CPUCores self.Hardware_Availability_Year=Hardware_Availability_Year + self.VHost_Ratio = VHost_Ratio # Since no process is ever started we just return None def get_stderr(self): @@ -103,6 +104,8 @@ def read_metrics(self, run_id, containers=None): df.value = df.value.apply(lambda x: interpolated_predictions[x / 100]) # will result in W + df.value = df.value*self.VHost_Ratio # apply vhost_ratio + df.value = (df.value * df.time.diff()) / 1_000 # W * us / 1_000 will result in mJ # we checked at ingest if it contains NA values. So NA can only occur if group diff resulted in only one value.