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

Negative consumption values reported #7

Closed JeremyNison closed 7 months ago

JeremyNison commented 1 year ago

Negative consumption values are sometimes reported in the generated .csv files. The occurences of this kind of values is variable and likly dependait of the monitored application. Particularly, executing JoularJX with the "avrora" benchmark form the DaCapo-9.12-bach benchmark suite will likely generate a bunch of negative values.

Executing the command java -javaagent:<path to joular jx jar> -jar <path to dacapo jar> avrora --size large will generate this kind of reports joularJX-11032-all-methods-energy.csv where several methods shows a negative energy consumption.

Monitoring other benchmarks of the suite, such as jython, will not generate any negative value.

adelnoureddine commented 1 year ago

This is usually because either the process or the Java thread is terminated before the 2nd power measurement in the loop. Hence, the negative value (0 - P1). Hopefully in the next version, we will remove the negative values that comes from this thread/process termination issue.

adelnoureddine commented 11 months ago

Potential fixes available in PR #35.

adelnoureddine commented 8 months ago

@kifetew would you be willing to suggest your fixes to our develop branch? Feel free to submit a PR. There has been and are going to be a few changes to the mac powermetrics measurements (see issue #54 and PR #55)

kifetew commented 8 months ago

sure, I'll submit a PR from my fork. I've made a number of changes to fix the negative values issue and also to make it work on Macos. My fixes need check/review on your side though to make sure that I did not misunderstand some aspects. There's also the point of watt (in mac) vs joule (in linux) that is currently implemented in joularjx to keep in mind while interpreting the results.