JoularJX is a Java-based agent for software power monitoring at the source code level.
Detailed documentation (including user and reference guides) are available at: https://joular.github.io/joularjx/.
To build JoularJX, you need Java 11+ and Maven, then just build:
mvn clean install -DskipTests
Alternatively, you can use the Maven wrapper shipped with the project with the command:
Linux: ./mvnw clean install -DskipTests
Windows: ./mvnw.cmd clean install -DskipTests
JoularJX depend on the following software or packages in order to get power reading:
config.properties
.powermetrics
, a tool bundled with macOS which requires running with sudo
access. It is recommended to authorize the current users to run /usr/bin/powermetrics
without requiring a password by making the proper modification to the sudoers
file.We also support Asus Tinker Board (S).
JoularJX is a Java agent where you can simply hook it to the Java Virtual Machine when starting your Java program's main class:
java -javaagent:joularjx-$version.jar YourProgramMainClass
If your program is a JAR file, then just run it as usual while adding JoularJX:
java -javaagent:joularjx-$version.jar -jar yourProgram.jar
JoularJX will generate multiple CSV files according to the configuration settings (in config.properties
), and will create these files in a joularjx-results
folder.
The generated files are available under the following folder structure:
filter-method-names
setting)
JoularJX can be configured by modifying the config.properties
files:
filter-method-names
: list of strings which will be used to filter the monitored methods (see Generated files below for explanations).save-runtime-data
: write runtime methods power consumption in a CSV file.overwrite-runtime-data
: overwrite runtime power data files, or if set to false, it will write new files for each monitoring cycle.logger-level
: set the level of information (by logger) given by JoularJX in the terminal (allowed values: OFF, INFO, WARNING, SEVERE).powermonitor-path
: Full path to the Power Monitor for Windows program (only for Windows).track-consumption-evolution
: generate CSV files for each method containing details of the method's consumption over the time. Each consumption value is mapped to an Unix timestamp.hide-agent-consumption
: if set to true, the energy consumption of the agent threads will not be reported.enable-call-trees-consumption
: compute methods call trees energy consumption. A CSV file will be generated at the end of the agent's execution, associating to each call tree it's total energy consumption.save-call-trees-runtime-data
: write runtime call trees power consumption in a CSV file. For each monitoring cycle (1 second), a new CSV file will be generated, containing the runtime power consumption of the call trees. The generated files will include timestamps in their names.overwrite-call-trees-runtime-data
: overwrite runtime call trees power data file, or if set to false, it will write new file for each monitoring cycle.application-server
: properly handles application servers and frameworks (Sprig Boot, Tomcat, etc.). Set true
when running on application servers. If false, the monitoring loop will check if the JVM is destroyed, hence closing JoularJX when the application ends (in regular Java application). If true, JoularJX will continue to monitor correctly as the JVM isn't destroyed in a application server.vm-power-path
: the path for the power consumption of the virtual machine. Inside a virtual machine, indicate the file containing power consumption of the VM (which is usually a file in the host that is shared with the guest).vm-power-format
: power format of the shared VM power file. We currently support two formats: watts
(a file containing one float value which is the power consumption of the VM), and powerjoular
(a csv file generated by PowerJoular in the host, containing 3 columns: timestamp, CPU utilization of the VM and CPU power of the VM).You can install the jar package (and the PowerMonitor.exe on Windows) wherever you want, and call it in the javaagent
with the full path.
However, config.properties
must either be copied to the same folder as where you run the Java command or its location must be set with the -Djoularjx.config=/path/to/config.properties
property when running your program.
In virtual machines, JoularJX requires two steps:
For real-time power data or the total energy at the program exit, JoularJX generated two CSV files:
config.properties
). This data is not just a subset of the first data file, but rather a recalculation done by JoularJX to provide accurate data: methods that start with the filtered keyword, will be allocated the power or energy consumed by the JDK methods that it calls.For example, if Package1.MethodA
calls java.io.PrintStream.println
to print some text to a terminal, then we calculate:
println
separately from MethodA
. The latter power consumption won't include those consumed by println
.Package1
, then the power consumption of println
will be added to MethodA
power consumption, and the file will only provide power or energy of Package1
methods.We manage to do this by analyzing the stacktrace of all running threads on runtime.
JoularJX Reader is a GUI to process, analyze and visualize JoularJX generated energy files. It is available at its own repository here.
To cite our work in a research paper, please cite our paper in the 18th International Conference on Intelligent Environments (IE2022).
@inproceedings{noureddine-ie-2022,
title = {PowerJoular and JoularJX: Multi-Platform Software Power Monitoring Tools},
author = {Noureddine, Adel},
booktitle = {18th International Conference on Intelligent Environments (IE2022)},
address = {Biarritz, France},
year = {2022},
month = {Jun},
keywords = {Power Monitoring; Measurement; Power Consumption; Energy Analysis}
}
JoularJX is licensed under the GNU GPL 3 license only (GPL-3.0-only).
Copyright (c) 2021-2024, Adel Noureddine, Université de Pau et des Pays de l'Adour. All rights reserved. This program and the accompanying materials are made available under the terms of the GNU General Public License v3.0 only (GPL-3.0-only) which accompanies this distribution, and is available at: https://www.gnu.org/licenses/gpl-3.0.en.html
Author : Adel Noureddine