joular / joularjx

JoularJX is a Java-based agent for software power monitoring at the source code level.
https://www.noureddine.org/research/joular/joularjx
GNU General Public License v3.0
71 stars 17 forks source link

WIP: fix for energy consumptions values being infinite #35

Closed MagielBruntink closed 11 months ago

MagielBruntink commented 11 months ago

Occasionaly, the reported energy consumption values of methods or stacktraces are Infinite. This is caused by the totalEncounters variable being 0 in those cases. The root cause of that is unknown at this point. A WIP fix is to add guards that check against 0 values, and reporting 0.0 power consumption in those cases.

Perhaps there is a deeper cause to totalEncounters being 0, which does appear suspect given that the algorithm is iterating over defined key-value pairs.

adelnoureddine commented 11 months ago

Thanks @MagielBruntink for the PR. We have some issues also with negative values, hopefully your PR might fix some of these too. Could you please base your PR on the develop branch instead?

MagielBruntink commented 11 months ago

@adelnoureddine re-based and re-targetted the PR.

adelnoureddine commented 11 months ago

Thanks, all fine with me, I just merged your PR.