Package org.jppf.ui.monitoring.data
Class StatsHandler
java.lang.Object
org.jppf.ui.monitoring.data.BaseStatsHandler
org.jppf.ui.monitoring.data.StatsHandler
This class provides a convenient access to the statistics obtained from the JPPF server.
- Author:
- Laurent Cohen
-
Field Summary
FieldsFields inherited from class org.jppf.ui.monitoring.data.BaseStatsHandler
dataHolderMap, refreshInterval, rolloverPosition -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyStatsToClipboard(int format) Copy the currently displayed statistics to the clipboard.Get the client handler.Return theConnectionDataHolderfor the current connection.getDoubleValues(int position) Get the mapping of a data snapshot's fields, at a specified position, to their corresponding double values.protected StatsFormattergetFormatter(Locale locale) Get, and create if needed, the formatter for the specified locale.static StatsHandlerGet the singleton instance of this class.org.jppf.client.monitoring.jobs.JobMonitorGet the object which monitors and maintains a representation of the jobs hierarchy.Get the mapping of the most recent data snapshot's fields to their corresponding double values.Get the mapping of the most recent data snapshot's fields to their corresponding string values.intGet the current number of data snapshots.getStringValues(int position) Get the mapping of a data snapshot's fields, at a specified position, to their corresponding string values.org.jppf.client.monitoring.topology.TopologyManagerGet the object which monitors and maintains a representation of the grid topology.static booleanDetermine whether an instance of this class was created.voidRequest an update from the current server connection.voidReset the statistics of the currently selected driver, if any.voidStop the automatic refresh of the stats through a timer.voidupdate(org.jppf.client.monitoring.topology.TopologyDriver driver, org.jppf.utils.stats.JPPFStatistics stats) Update the current statistics with new values obtained from the server.Methods inherited from class org.jppf.ui.monitoring.data.BaseStatsHandler
addStatsHandlerListener, fireStatsHandlerEvent, formatLatestValue, getDoubleValues, getLatestDoubleValues, getLatestStringValues, getRefreshInterval, getRolloverPosition, getShowIPHandler, getStatsCount, getStringValues, getTickCount, removeStatsHandlerListener, requestUpdate, setRefreshInterval
-
Field Details
-
timer
Timer used to query the stats from the server.
-
-
Method Details
-
getInstance
Get the singleton instance of this class.- Returns:
- a
StatsHandlerinstance.
-
hasInstance
public static boolean hasInstance()Determine whether an instance of this class was created.- Returns:
trueif an instance was created,falseotherwise.
-
stopRefreshTimer
public void stopRefreshTimer()Stop the automatic refresh of the stats through a timer. -
requestUpdate
public void requestUpdate()Request an update from the current server connection. -
update
public void update(org.jppf.client.monitoring.topology.TopologyDriver driver, org.jppf.utils.stats.JPPFStatistics stats) Description copied from class:BaseStatsHandlerUpdate the current statistics with new values obtained from the server.- Overrides:
updatein classBaseStatsHandler- Parameters:
driver- represents the client connection from which the data is obtained.stats- the object holding the new statistics values.
-
getStatsCount
public int getStatsCount()Get the current number of data snapshots.- Returns:
- the number of snapshots as an int.
-
getCurrentDataHolder
Return theConnectionDataHolderfor the current connection.- Returns:
- a
ConnectionDataHolderinstance.
-
getStringValues
Get the mapping of a data snapshot's fields, at a specified position, to their corresponding string values.- Parameters:
position- the position to get the data at.- Returns:
- a map of field names to their values represented as strings.
-
getLatestStringValues
Get the mapping of the most recent data snapshot's fields to their corresponding string values.- Returns:
- a map of field names to their values represented as strings.
-
getDoubleValues
Get the mapping of a data snapshot's fields, at a specified position, to their corresponding double values.- Parameters:
position- the position to get the data at.- Returns:
- a map of field names to their values represented as double values.
-
getLatestDoubleValues
Get the mapping of the most recent data snapshot's fields to their corresponding double values.- Returns:
- a map of field names to their values represented as double values.
-
copyStatsToClipboard
public void copyStatsToClipboard(int format) Copy the currently displayed statistics to the clipboard.- Parameters:
format- specifies the format, among the constants defined inStatsExporter.
-
resetCurrentStats
public void resetCurrentStats()Reset the statistics of the currently selected driver, if any. -
getClientHandler
Get the client handler.- Returns:
- a
ClientHandlerobject.
-
getTopologyManager
public org.jppf.client.monitoring.topology.TopologyManager getTopologyManager()Get the object which monitors and maintains a representation of the grid topology.- Returns:
- a
TopologyManagerobject.
-
getJobMonitor
public org.jppf.client.monitoring.jobs.JobMonitor getJobMonitor()Get the object which monitors and maintains a representation of the jobs hierarchy.- Returns:
- a
JobMonitorinstance.
-
getFormatter
Description copied from class:BaseStatsHandlerGet, and create if needed, the formatter for the specified locale.- Overrides:
getFormatterin classBaseStatsHandler- Parameters:
locale- the locale to use for values formatting.- Returns:
- a
StatsFormatterinstance.
-