use of oshi.software.os.OSProcess in project buck by facebook.
the class ProcessHelper method getProcessResourceConsumption.
/**
* Gets resource consumption of the process with the given pid.
*/
@Nullable
public ProcessResourceConsumption getProcessResourceConsumption(long pid) {
try {
OperatingSystem os = OSHI.getOperatingSystem();
OSProcess process = os.getProcess((int) pid);
return getProcessResourceConsumptionInternal(process);
} catch (Exception ex) {
// do nothing
return null;
}
}
Aggregations