/** * Build a new process tree rooted at the pid. * * This method is provided mainly for testing purposes, where * the root of the proc file system can be adjusted. * * @param pid root of the process tree * @param procfsDir the root of a proc file system - only used for testing. * @param clock clock for controlling time for testing */ public ProcfsBasedProcessTree(String pid, String procfsDir, Clock clock) { super(pid); this.clock = clock; this.pid = getValidPID(pid); this.procfsDir = procfsDir; this.cpuTimeTracker = new CpuTimeTracker(JIFFY_LENGTH_IN_MILLIS); }
/** * Build a new process tree rooted at the pid. * * This method is provided mainly for testing purposes, where * the root of the proc file system can be adjusted. * * @param pid root of the process tree * @param procfsDir the root of a proc file system - only used for testing. * @param clock clock for controlling time for testing */ public ProcfsBasedProcessTree(String pid, String procfsDir, Clock clock) { super(pid); this.clock = clock; this.pid = getValidPID(pid); this.procfsDir = procfsDir; this.cpuTimeTracker = new CpuTimeTracker(JIFFY_LENGTH_IN_MILLIS); }
/** * Build a new process tree rooted at the pid. * * This method is provided mainly for testing purposes, where * the root of the proc file system can be adjusted. * * @param pid root of the process tree * @param procfsDir the root of a proc file system - only used for testing. * @param clock clock for controlling time for testing */ public ProcfsBasedProcessTree(String pid, String procfsDir, Clock clock) { super(pid); this.clock = clock; this.pid = getValidPID(pid); this.procfsDir = procfsDir; this.cpuTimeTracker = new CpuTimeTracker(JIFFY_LENGTH_IN_MILLIS); }