use of com.insightfullogic.honest_profiler.ports.sources.LocalMachineSource in project honest-profiler by jvm-profiling-tools.
the class AgentIntegrationTest method discoverVirtualMachines.
private AtomicReference<Profile> discoverVirtualMachines() {
AtomicReference<Profile> lastProfile = new AtomicReference<>();
parkNanos(SECONDS.toNanos(1));
new LocalMachineSource(logger, new MachineListener() {
@Override
public void onNewMachine(final VirtualMachine machine) {
if (machine.isAgentLoaded()) {
final FileLogSource logSource = (FileLogSource) machine.getLogSource();
file.set(logSource);
Monitor.pipeFile(logSource, lastProfile::set);
}
}
@Override
public void onClosedMachine(final VirtualMachine machine) {
}
}).discoverVirtualMachines();
return lastProfile;
}
use of com.insightfullogic.honest_profiler.ports.sources.LocalMachineSource in project honest-profiler by jvm-profiling-tools.
the class RootController method initialize.
// FXML Implementation
@Override
@FXML
public void initialize() {
super.initialize();
setApplicationContext(new ApplicationContext(this));
// Bind the InfoBar Node to the ApplicationContext.
info.textProperty().bind(appCtx().getInfo());
// Monitor running VMs on the local machine.
machineSource = new LocalMachineSource(getLogger(getClass()), this);
machineSource.start();
}
Aggregations