Skip to content

Commit

Permalink
allow to set the config.properties through system property
Browse files Browse the repository at this point in the history
  • Loading branch information
misto committed Aug 6, 2024
1 parent 08c9a16 commit 784b4d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ JoularJX can be configured by modifying the ```config.properties``` files:
- ```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](https://github.com/joular/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 be copied to the same folder as where you run the Java command.
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:
- Installing a power monitoring tool in the host machine, which will monitor the virtual machine power consumption every second and writing it to a file (to be shared with the guest VM).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public int loadStackMonitoringSampleRate() {
}

private Optional<Path> getPropertiesPathIfExists(FileSystem fileSystem) {
Path path = fileSystem.getPath("config.properties");
Path path = fileSystem.getPath(System.getProperty("joularjx.config", "config.properties"));

if (Files.notExists(path)) {
logger.log(Level.INFO, "Could not locate config.properties, will use default values");
Expand Down

0 comments on commit 784b4d1

Please sign in to comment.