Class StatsHandler

java.lang.Object
org.jppf.ui.monitoring.data.BaseStatsHandler
org.jppf.ui.monitoring.data.StatsHandler

public final class StatsHandler extends BaseStatsHandler
This class provides a convenient access to the statistics obtained from the JPPF server.
Author:
Laurent Cohen
  • Field Details

    • timer

      protected Timer timer
      Timer used to query the stats from the server.
  • Method Details

    • getInstance

      public static StatsHandler getInstance()
      Get the singleton instance of this class.
      Returns:
      a StatsHandler instance.
    • hasInstance

      public static boolean hasInstance()
      Determine whether an instance of this class was created.
      Returns:
      true if an instance was created, false otherwise.
    • 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: BaseStatsHandler
      Update the current statistics with new values obtained from the server.
      Overrides:
      update in class BaseStatsHandler
      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

      public ConnectionDataHolder getCurrentDataHolder()
      Return the ConnectionDataHolder for the current connection.
      Returns:
      a ConnectionDataHolder instance.
    • getStringValues

      public Map<Fields,String> getStringValues(int position)
      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

      public Map<Fields,String> 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

      public Map<Fields,Double> getDoubleValues(int position)
      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

      public Map<Fields,Double> 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 in StatsExporter.
    • resetCurrentStats

      public void resetCurrentStats()
      Reset the statistics of the currently selected driver, if any.
    • getClientHandler

      public ClientHandler getClientHandler()
      Get the client handler.
      Returns:
      a ClientHandler object.
    • getTopologyManager

      public org.jppf.client.monitoring.topology.TopologyManager getTopologyManager()
      Get the object which monitors and maintains a representation of the grid topology.
      Returns:
      a TopologyManager object.
    • getJobMonitor

      public org.jppf.client.monitoring.jobs.JobMonitor getJobMonitor()
      Get the object which monitors and maintains a representation of the jobs hierarchy.
      Returns:
      a JobMonitor instance.
    • getFormatter

      protected StatsFormatter getFormatter(Locale locale)
      Description copied from class: BaseStatsHandler
      Get, and create if needed, the formatter for the specified locale.
      Overrides:
      getFormatter in class BaseStatsHandler
      Parameters:
      locale - the locale to use for values formatting.
      Returns:
      a StatsFormatter instance.