powerapi-ng / pyJoules

A Python library to capture the energy consumption of code snippets
MIT License
70 stars 10 forks source link

Implement quick fix for negative energy readings and add known issues to README #21

Closed kaminetzky closed 3 years ago

kaminetzky commented 3 years ago

Whenever a counter overflows, pyJoules will report a negative energy measurement.

As a quick fix, I propose adding the corresponding max_energy_range_uj to negative energy measurements.

If a counter overflows twice during a single energy measurement, the reported energy will be max_energy_range_uj less than the expected value.

I also added this information to the README.