JoularJX
Purpose:: Java-based agent for software power monitoring at the source code level
Type:: #tool/dev
Website:: https://www.noureddine.org/research/joular/joularjx
Docs:: https://joular.github.io/joularjx/
Source Code:: https://github.com/joular/joularjx
Created by:: Adel Noureddine
Status:: 💡
Description
JoularJX is a Java-based agent for power monitoring at the source code level with support for modern Java versions and multi-OS to monitor power consumption of hardware and software.
JoularJX is a Java agent where you can simply hook it to the Java Virtual Machine when starting your Java program. To get power readings, JoularJX uses a custom PowerMonitor program (based on Intel Power Gadget API) on Windows, Intel RAPL (through powercap) on GNU/Linux, and our accurate power models on Raspberry Pi and similar devices.
How it works
The monitoring process is as follows:
- Every application monitoring cycle (by default, 1 second), JoularJX collects the CPU usage of the JVM and calculates the power consumption of the entire JVM (on Windows, using the PowerMonitor.exe program using Intel API, on x86_64 Linux using RAPL interface in the Linux kernel, and on Raspberry Pi and Asus Tinker Board using our regression power models).
- Then, JoularJX collects the CPU usage of each thread in the JVM using the JDK's
getThreadCpuTime
method, and calculates the power consumption of each thread. - Every source code monitoring cycle (by default, 10 milliseconds), JoularJX checks, for each thread, the stacktrace and identify the method being executed (the method on top of the stacktrace). At the end of the application monitoring cycle, JoularJX statistically analyzes the ratio of each method observed in the stacktrace, and allocate the power consumption.
Command line
java -javaagent:joularjx-$version.jar yourProgram
GUI
JoularJX GUI allows developers to view and analyze the power and energy consumption of their Java applications for every method and for every execution branch.
The GUI reads the folders and files generated by JoularJX Java agent, and displays the results, along with analysis, in the interface.