Skip to content
Merged
Show file tree
Hide file tree
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 @@ -2,19 +2,27 @@

import java.time.Duration;

import jakarta.enterprise.event.Observes;
import jakarta.inject.Inject;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.MediaType;

import org.jboss.resteasy.reactive.RestStreamElementType;

import io.quarkus.logging.Log;
import io.quarkus.runtime.StartupEvent;
import io.smallrye.mutiny.Multi;

@Path("/power")
public class PowerResource {
@Inject
PowerMeasurer measurer;

public void onStartup(@Observes StartupEvent event) {
Log.info("\nConfigured sampling period: " + samplingPeriod() +
"\nDetected metadata:\n" + metadata());
}

@GET
@RestStreamElementType(MediaType.APPLICATION_JSON)
@Path("{pid}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.HashSet;
import java.util.regex.Pattern;

import io.quarkus.logging.Log;
import net.laprun.sustainability.power.SensorMeasure;
import net.laprun.sustainability.power.SensorMetadata;
import net.laprun.sustainability.power.sensors.AbstractPowerSensor;
Expand Down Expand Up @@ -89,7 +88,6 @@ void initMetadata(InputStream inputStream) {
final var metadata = new SensorMetadata(components,
"macOS powermetrics derived information, see https://firefox-source-docs.mozilla.org/performance/powermetrics.html");
cpu.setMetadata(metadata);
Log.info("Detected metadata:\n" + metadata);
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down
Loading