Class CPUsDetailedPercConverter
java.lang.Object
kieker.monitoring.sampler.oshi.samplers.CPUsDetailedPercConverter
public class CPUsDetailedPercConverter
extends java.lang.Object
Converts and stores CPU percentages (of i.e., User + Sys + Nice + Wait) The
conversion is made by collecting the ticks at two different times,
calculating the deltas and by calculating the relative values. The last
calculated relative values (percentages) are stored in lastConversion.
Specific metrics can be accessed by the given getters.
- Since:
- 1.14
- Author:
- Matteo Sassano
-
Constructor Summary
Constructors Constructor Description CPUsDetailedPercConverter(int coreIndex)
CPUsDetailedPercConverter constructor. -
Method Summary
Modifier and Type Method Description void
convertToPercentage()
Calculates the percentages of system, nice, user,...double
getCombinedPerc()
int
getCoreIndex()
double
getIdlePerc()
double
getIrqPerc()
double
getNicePerc()
double
getSystemPerc()
double
getUserPerc()
double
getWaitPerc()
void
passNewProcessorLoadTicks(long[] processorLoadTicks)
Stores a new measurement spot for a given CPU core.
-
Constructor Details
-
CPUsDetailedPercConverter
public CPUsDetailedPercConverter(int coreIndex)CPUsDetailedPercConverter constructor.- Parameters:
coreIndex
- holds the CPU core index
-
-
Method Details
-
passNewProcessorLoadTicks
public void passNewProcessorLoadTicks(long[] processorLoadTicks)Stores a new measurement spot for a given CPU core. The new measurement spot must be measured at least one second after the last one. Otherwise, the invocation of this method will be ignored. In the normal case, passing new measurements leads to a shift of the last ones to processorLoadTicksT0 measurement and the new ones are stored in processorLoadTicksT1- Parameters:
processorLoadTicks
- the new measurements at the current time
-
convertToPercentage
public void convertToPercentage()Calculates the percentages of system, nice, user,... by utilizing the difference of two measurement spots. (processorLoadTicksT0 and processorLoadTicksT1). The second measurement spot must be measured at least one second later than the first one. If the second measurement spot is not available yet, the average percentages starting from the boot start will be calculated. If neither the first nor the second measurement spot is available, nothing will be calculated. The results are stored in lastConvesion -
getSystemPerc
public double getSystemPerc()- Returns:
- the system utilization of the given core.
-
getNicePerc
public double getNicePerc()- Returns:
- the nice of the given core.
-
getWaitPerc
public double getWaitPerc()- Returns:
- the I/O wait of the given core.
-
getUserPerc
public double getUserPerc()- Returns:
- the user utilization of the given core.
-
getIrqPerc
public double getIrqPerc()- Returns:
- the IRQ of the given core.
-
getIdlePerc
public double getIdlePerc()- Returns:
- the IDLE of the given core.
-
getCombinedPerc
public double getCombinedPerc()- Returns:
- the combined utilization of the given core.
-
getCoreIndex
public int getCoreIndex()- Returns:
- the core index related to the converter.
-