Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,7 @@ public void start(long frequency) throws Exception {
if (!isStarted()) {
// it takes some time for the external process in addition to the sampling time so adjust the sampling frequency to account for this so that at most one measure occurs during the sampling time window
final var freq = Long.toString(frequency - 50);
// powermetrics = new ProcessBuilder().command("sudo", "powermetrics", "--samplers cpu_power,tasks", "--show-process-samp-norm", "--show-process-gpu", "-i " + freq).start(); // for some reason this doesn't work
powermetrics = Runtime.getRuntime()
.exec("sudo powermetrics --samplers cpu_power,tasks --show-process-samp-norm --show-process-gpu -i " + freq);

powermetrics = new ProcessBuilder().command("sudo", "powermetrics", "--samplers", "cpu_power,tasks", "--show-process-samp-norm", "--show-process-gpu", "-i", freq).start();
}
}

Expand All @@ -251,8 +248,6 @@ public boolean isStarted() {

@Override
public Map<RegisteredPID, double[]> update(Long tick) {
System.out.println("tick = " + tick);
System.out.println("trackedPIDs = " + trackedPIDs);
return extractPowerMeasure(powermetrics.getInputStream());
}

Expand Down