diff --git a/metric_providers/cpu/energy/rapl/msr/component/provider.py b/metric_providers/cpu/energy/rapl/msr/component/provider.py index 39c30a3e..13831805 100644 --- a/metric_providers/cpu/energy/rapl/msr/component/provider.py +++ b/metric_providers/cpu/energy/rapl/msr/component/provider.py @@ -9,7 +9,7 @@ def __init__(self, resolution, skip_check=False): metric_name='cpu_energy_rapl_msr_component', metrics={'time': int, 'value': int, 'package_id': str}, resolution=resolution, - unit='mJ', + unit='uJ', current_dir=os.path.dirname(os.path.abspath(__file__)), skip_check=skip_check, ) diff --git a/metric_providers/cpu/energy/rapl/msr/component/source.c b/metric_providers/cpu/energy/rapl/msr/component/source.c index bfee9246..402f7c1f 100644 --- a/metric_providers/cpu/energy/rapl/msr/component/source.c +++ b/metric_providers/cpu/energy/rapl/msr/component/source.c @@ -475,11 +475,11 @@ static void rapl_msr(int measurement_mode) { if(energy_output>=0) { gettimeofday(&now, NULL); if (measurement_mode == MEASURE_ENERGY_PKG) { - printf("%ld%06ld %ld Package_%d\n", now.tv_sec, now.tv_usec, (long int)(energy_output*1000), k); + printf("%ld%06ld %lld Package_%d\n", now.tv_sec, now.tv_usec, (long long)energy_output, k); } else if (measurement_mode == MEASURE_DRAM) { - printf("%ld%06ld %ld DRAM_%d\n", now.tv_sec, now.tv_usec, (long int)(energy_output*1000), k); + printf("%ld%06ld %lld DRAM_%d\n", now.tv_sec, now.tv_usec, (long long)energy_output, k); } else if (measurement_mode == MEASURE_PSYS) { - printf("%ld%06ld %ld PSYS_%d\n", now.tv_sec, now.tv_usec, (long int)(energy_output*1000), k); + printf("%ld%06ld %lld PSYS_%d\n", now.tv_sec, now.tv_usec, (long long)energy_output, k); } } /* diff --git a/metric_providers/psu/energy/ac/mcp/machine/provider.py b/metric_providers/psu/energy/ac/mcp/machine/provider.py index c56d89c1..58a1e331 100644 --- a/metric_providers/psu/energy/ac/mcp/machine/provider.py +++ b/metric_providers/psu/energy/ac/mcp/machine/provider.py @@ -40,7 +40,7 @@ def _parse_metrics(self, df): df.dropna(inplace=True) df['interval'] = intervals # in microseconds - df['value'] = df.apply(lambda x: x['value'] * x['interval'] / 1_000_00, axis=1) # value is in centiwatts, so divide by 1_000_00 instead of 1_000 as we would do for Watts + df['value'] = df.apply(lambda x: x['value'] * x['interval'] / 1_00, axis=1) # value is in centiwatts (1/100 W), so divide by 1_00 instead of 1 as we would do for Watts to get micro-Joules df['value'] = df.value.astype(int) df = df.drop(columns='interval') # clean up