Class CpuDataImpl
java.lang.Object
javax.management.NotificationBroadcasterSupport
com.ibm.java.diagnostics.healthcenter.api.impl.HealthCenterDataImpl
com.ibm.java.diagnostics.healthcenter.api.cpu.impl.CpuDataImpl
- All Implemented Interfaces:
CpuData,HealthCenterData,NotificationBroadcaster,NotificationEmitter
-
Field Summary
Fields inherited from class com.ibm.java.diagnostics.healthcenter.api.impl.HealthCenterDataImpl
DEFAULT_NOTIFICATION, UNSETFields inherited from interface com.ibm.java.diagnostics.healthcenter.api.cpu.CpuData
PROCESSUSEDATA, SYSTEMUSEDATA -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCpuListener(CpuEventListener listener) Add a listener for notification of when CPU events occurdoubleGets the maximum percentage value for process CPU use.doubleGets the maximum percentage value for system CPU use.doubleGets the mean percentage value for process CPU use.doubleGets the mean percentage value for system CPU use.doubleGets the minimum percentage value for process CPU use.doubleGets the minimum percentage value for system CPU use.CpuInfo[]Gets the data associated with the process CPU use.protected Stringprotected StringCpuInfo[]Gets the data associated with the system CPU use.voidStarts a thread which checks for changes in the data every 2000 milliseconds and sends notifications if an update has occurred.voidstartNotifying(long delay) Starts a thread which checks for changes in the data and sends notifications if an update has occurred.Methods inherited from class com.ibm.java.diagnostics.healthcenter.api.impl.HealthCenterDataImpl
convertSummaryToDouble, convertSummaryToInt, convertSummaryToLong, extractRate, findAllRecommendations, findRecommendations, getAllRecommendations, getCriticalRecommendations, getEventData, getHealthyRecommendations, getInformationalRecommendations, getJvmData, getMaxData, getMeanData, getMinData, getWarningRecommendations, setJvmData, stripPercentSymbolMethods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotificationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.ibm.java.diagnostics.healthcenter.api.HealthCenterData
getAllRecommendations, getCriticalRecommendations, getHealthyRecommendations, getInformationalRecommendations, getWarningRecommendationsMethods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, getNotificationInfo, removeNotificationListenerMethods inherited from interface javax.management.NotificationEmitter
removeNotificationListener
-
Constructor Details
-
CpuDataImpl
public CpuDataImpl(com.ibm.java.diagnostics.common.datamodel.data.Data data)
-
-
Method Details
-
getRecommendationLabel
- Specified by:
getRecommendationLabelin classHealthCenterDataImpl
-
getSubsystemLabel
- Specified by:
getSubsystemLabelin classHealthCenterDataImpl
-
getProcessUse
Description copied from interface:CpuDataGets the data associated with the process CPU use. NOTE If running in "event only" mode, this data will always return an empty array. This is because "event only" does not store any data to inquire on. Instead, you need to use the api calls to register listeners and get notification of when events occur- Specified by:
getProcessUsein interfaceCpuData- Returns:
- an array of CpuInfo objects.
-
getSystemUse
Description copied from interface:CpuDataGets the data associated with the system CPU use. NOTE If running in "event only" mode, this data will always return an empty array. This is because "event only" does not store any data to inquire on. Instead, you need to use the api calls to register listeners and get notification of when events occur- Specified by:
getSystemUsein interfaceCpuData- Returns:
- an array of CpuInfo objects.
-
startNotifying
public void startNotifying()Description copied from interface:HealthCenterDataStarts a thread which checks for changes in the data every 2000 milliseconds and sends notifications if an update has occurred. To handle these notifications, aNotificationListenerneeds to be added to the object the thread is being started from.- Specified by:
startNotifyingin interfaceHealthCenterData
-
startNotifying
public void startNotifying(long delay) Description copied from interface:HealthCenterDataStarts a thread which checks for changes in the data and sends notifications if an update has occurred. To handle these notifications, aNotificationListenerneeds to be added to the object the thread is being started from.- Specified by:
startNotifyingin interfaceHealthCenterData- Parameters:
delay- The number of milliseconds between each update. The default is 2000 milliseconds and anything below this will not be accepted.
-
getMaxSystemUse
public double getMaxSystemUse()Description copied from interface:CpuDataGets the maximum percentage value for system CPU use.- Specified by:
getMaxSystemUsein interfaceCpuData- Returns:
- maximum percentage as a double
-
getMeanSystemUse
public double getMeanSystemUse()Description copied from interface:CpuDataGets the mean percentage value for system CPU use.- Specified by:
getMeanSystemUsein interfaceCpuData- Returns:
- mean percentage as a double
-
getMinSystemUse
public double getMinSystemUse()Description copied from interface:CpuDataGets the minimum percentage value for system CPU use.- Specified by:
getMinSystemUsein interfaceCpuData- Returns:
- minimum percentage as a double
-
getMaxProcessUse
public double getMaxProcessUse()Description copied from interface:CpuDataGets the maximum percentage value for process CPU use.- Specified by:
getMaxProcessUsein interfaceCpuData- Returns:
- maximum percentage as a double
-
getMeanProcessUse
public double getMeanProcessUse()Description copied from interface:CpuDataGets the mean percentage value for process CPU use.- Specified by:
getMeanProcessUsein interfaceCpuData- Returns:
- mean percentage as a double
-
getMinProcessUse
public double getMinProcessUse()Description copied from interface:CpuDataGets the minimum percentage value for process CPU use.- Specified by:
getMinProcessUsein interfaceCpuData- Returns:
- minimum percentage as a double
-
addCpuListener
Description copied from interface:CpuDataAdd a listener for notification of when CPU events occur- Specified by:
addCpuListenerin interfaceCpuData
-