Class SystemResourcesCounter
java.lang.Object
java.lang.Thread
org.apache.flink.runtime.metrics.util.SystemResourcesCounter
- All Implemented Interfaces:
Runnable
Daemon thread probing system resources.
To accurately and consistently report CPU and network usage we have to periodically probe CPU ticks and network sent/received bytes and then convert those values to CPU usage and send/receive byte rates.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubledoubledoubledoubledoubledoubledoubledoubledoubledoubledoublegetCpuUsagePerProcessor(int processor) doubledoubleString[]intlonggetReceiveRatePerInterface(int interfaceNo) longgetSendRatePerInterface(int interfaceNo) voidrun()voidshutdown()Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
SystemResourcesCounter
-
-
Method Details
-
run
public void run() -
shutdown
- Throws:
InterruptedException
-
getCpuUser
public double getCpuUser() -
getCpuNice
public double getCpuNice() -
getCpuSys
public double getCpuSys() -
getCpuIdle
public double getCpuIdle() -
getIOWait
public double getIOWait() -
getCpuIrq
public double getCpuIrq() -
getCpuSoftIrq
public double getCpuSoftIrq() -
getCpuSteal
public double getCpuSteal() -
getCpuUsage
public double getCpuUsage() -
getCpuLoad1
public double getCpuLoad1() -
getCpuLoad5
public double getCpuLoad5() -
getCpuLoad15
public double getCpuLoad15() -
getProcessorsCount
public int getProcessorsCount() -
getCpuUsagePerProcessor
public double getCpuUsagePerProcessor(int processor) -
getNetworkInterfaceNames
-
getReceiveRatePerInterface
public long getReceiveRatePerInterface(int interfaceNo) -
getSendRatePerInterface
public long getSendRatePerInterface(int interfaceNo)
-