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

18 better organize generated power files #20

Closed JeremyNison closed 1 year ago

JeremyNison commented 1 year ago

Implementation of the new result files hierarchy, as discussed in issue #18 .

The new class ResultTreeManager is responsible for creating the required folders and provide methods for easily getting the needed filepaths when writing data. Particularly, this class is created in the Agent and is passed as an argument to the existing MonitoringHandler and ShutdownHandler class. Those classes uses it's methods to write data at the right place.

The methods saveResults in MonitoringHandler and in ShutdownHandler has also been refactored : the filepath creation has been extracted and is now independant from those methods, allowing to use the new ResultTreeManager more easily.

Finally, in the ShutdownHandler, the writing of the methods consumption evolution files has been refactored. It is now done with the saveResult method, instead of writeConsumptionEvolution that became obselete as all the folder creation job is now performed by the create() method of ResultTreeManager.

This pull request closes #18 .

JeremyNison commented 1 year ago

For the moment, the name of the folder corresponding to an execution does not match the template app_name-PID-start_timestamp as described in #18 , as getting the executed application name looks tricky. The app name is for the moment replaced by the string run, as in this example :

resfolderexample
JeremyNison commented 1 year ago

We decided not to include the app name in the generated result folder, and removed the "run" keyword. From now on, the result folder generated for each execution is named like this : PID-start_timestamp.