use of com.insightfullogic.honest_profiler.core.sources.VirtualMachine in project honest-profiler by jvm-profiling-tools.
the class MachinePicker method handleInput.
@Override
public void handleInput(int input) {
if (isDigit(input)) {
try {
int index = Character.getNumericValue(input);
System.out.println(input);
System.out.println(index);
VirtualMachine machine = machines.get(index);
terminal.display(new ProfileScreen(machine, this, terminal));
} catch (IndexOutOfBoundsException e) {
// Just ignore numbers out of the range
}
}
}
use of com.insightfullogic.honest_profiler.core.sources.VirtualMachine 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.core.sources.VirtualMachine in project honest-profiler by jvm-profiling-tools.
the class LocalMachineSource method onNewDescriptor.
private void onNewDescriptor(VirtualMachineDescriptor descriptor) {
VirtualMachine vm = attach(descriptor);
if (vm != null) {
vmMap.put(descriptor, vm);
listener.onNewMachine(vm);
}
}
Aggregations