@InterfaceAudience.Public @InterfaceStability.Evolving public abstract class ResourceCalculatorProcessTree extends Configured
Modifier and Type | Field and Description |
---|---|
static int |
UNAVAILABLE |
Constructor and Description |
---|
ResourceCalculatorProcessTree(String root)
Create process-tree instance with specified root process.
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
checkPidPgrpidForMatch()
Verify that the tree process id is same as its process group id.
|
float |
getCpuUsagePercent()
Get the CPU usage by all the processes in the process-tree based on
average between samples as a ratio of overall CPU cycles similar to top.
|
long |
getCumulativeCpuTime()
Get the CPU time in millisecond used by all the processes in the
process-tree since the process-tree was created
|
abstract String |
getProcessTreeDump()
Get a dump of the process-tree.
|
static ResourceCalculatorProcessTree |
getResourceCalculatorProcessTree(String pid,
Class<? extends ResourceCalculatorProcessTree> clazz,
Configuration conf)
Create the ResourceCalculatorProcessTree rooted to specified process
from the class name and configure it.
|
long |
getRssMemorySize()
Get the resident set size (rss) memory used by all the processes
in the process-tree.
|
long |
getRssMemorySize(int olderThanAge)
Get the resident set size (rss) memory used by all the processes
in the process-tree that are older than the passed in age.
|
long |
getVirtualMemorySize()
Get the virtual memory used by all the processes in the
process-tree.
|
long |
getVirtualMemorySize(int olderThanAge)
Get the virtual memory used by all the processes in the
process-tree that are older than the passed in age.
|
void |
initialize()
Initialize the object.
|
abstract void |
updateProcessTree()
Update the process-tree with latest state.
|
getConf, setConf
public static final int UNAVAILABLE
public ResourceCalculatorProcessTree(String root)
root
- process-tree root-processpublic void initialize() throws YarnException
YarnException
- Throws an exception on error.public abstract void updateProcessTree()
public abstract String getProcessTreeDump()
public long getVirtualMemorySize()
UNAVAILABLE
if it cannot be calculated.public long getRssMemorySize()
UNAVAILABLE
if it cannot be calculated.public long getVirtualMemorySize(int olderThanAge)
olderThanAge
- processes above this age are included in the
memory additionUNAVAILABLE
if it
cannot be calculated.public long getRssMemorySize(int olderThanAge)
olderThanAge
- processes above this age are included in the
memory additionUNAVAILABLE
if it cannot be
calculated.public long getCumulativeCpuTime()
UNAVAILABLE
if it cannot be calculated.public float getCpuUsagePercent()
UNAVAILABLE
if CPU usage cannot be calculated or not available.public abstract boolean checkPidPgrpidForMatch()
public static ResourceCalculatorProcessTree getResourceCalculatorProcessTree(String pid, Class<? extends ResourceCalculatorProcessTree> clazz, Configuration conf)
pid
- process pid of the root of the process treeclazz
- class-nameconf
- configure the plugin with this.Copyright © 2024 Apache Software Foundation. All rights reserved.