Class CpuUsageMetrics
- java.lang.Object
-
- org.apache.iotdb.metrics.metricsets.cpu.CpuUsageMetrics
-
- All Implemented Interfaces:
IMetricSet
public class CpuUsageMetrics extends java.lang.Object implements IMetricSet
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractMetricServicemetricServiceprotected java.util.Map<java.lang.Long,java.lang.String>threadIdToModuleCacheprotected java.util.Map<java.lang.Long,java.lang.String>threadIdToPoolCacheprotected java.util.function.UnaryOperator<java.lang.String>threadNameToModuleprotected java.util.function.UnaryOperator<java.lang.String>threadNameToPool
-
Constructor Summary
Constructors Constructor Description CpuUsageMetrics(java.util.List<java.lang.String> modules, java.util.List<java.lang.String> pools, java.util.function.UnaryOperator<java.lang.String> threadNameToModule, java.util.function.UnaryOperator<java.lang.String> threadNameToPool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbindTo(AbstractMetricService metricService)bind metrics to metricManager and init environment.java.util.Map<java.lang.String,java.lang.Double>getModuleCpuUsage()java.util.Map<java.lang.String,java.lang.Double>getModuleUserTimePercentage()java.util.Map<java.lang.String,java.lang.Double>getPoolCpuUsage()java.util.Map<java.lang.String,java.lang.Double>getPoolUserCpuPercentage()voidunbindFrom(AbstractMetricService metricService)remove metrics from metricManager and clear environment.
-
-
-
Field Detail
-
metricService
protected AbstractMetricService metricService
-
threadNameToModule
protected final java.util.function.UnaryOperator<java.lang.String> threadNameToModule
-
threadNameToPool
protected final java.util.function.UnaryOperator<java.lang.String> threadNameToPool
-
threadIdToModuleCache
protected final java.util.Map<java.lang.Long,java.lang.String> threadIdToModuleCache
-
threadIdToPoolCache
protected final java.util.Map<java.lang.Long,java.lang.String> threadIdToPoolCache
-
-
Method Detail
-
bindTo
public void bindTo(AbstractMetricService metricService)
Description copied from interface:IMetricSetbind metrics to metricManager and init environment.- Specified by:
bindToin interfaceIMetricSet
-
unbindFrom
public void unbindFrom(AbstractMetricService metricService)
Description copied from interface:IMetricSetremove metrics from metricManager and clear environment.- Specified by:
unbindFromin interfaceIMetricSet
-
getModuleCpuUsage
public java.util.Map<java.lang.String,java.lang.Double> getModuleCpuUsage()
-
getPoolCpuUsage
public java.util.Map<java.lang.String,java.lang.Double> getPoolCpuUsage()
-
getPoolUserCpuPercentage
public java.util.Map<java.lang.String,java.lang.Double> getPoolUserCpuPercentage()
-
getModuleUserTimePercentage
public java.util.Map<java.lang.String,java.lang.Double> getModuleUserTimePercentage()
-
-