java.lang.Object
org.ametys.runtime.plugins.admin.jvmstatus.monitoring.sample.AbstractSampleManager
All Implemented Interfaces:
PluginAware, MonitoringConstants, SampleManager, Configurable, LogEnabled, ThreadSafe
Direct Known Subclasses:
AbstractAlertSampleManager, AbstractMemorySampleManager, CacheSampleManager, CPUSampleManager, HttpRequestSampleManager, HttpSessionSampleManager, SessionSampleManager, UptimeSampleManager

AbstractSampleManager gives you the infrastructure for easily deploying a SampleManager.
  • Field Details

  • Constructor Details

  • Method Details

    • getId

      public String getId()
      Description copied from interface: SampleManager
      Provides the id of this manager.
      Must be unique in the application.
      Specified by:
      getId in interface SampleManager
      Returns:
      the id.
    • getLabel

      Description copied from interface: SampleManager
      Provides the human readable name to use.
      Specified by:
      getLabel in interface SampleManager
      Returns:
      the human readable name.
    • getDescription

      Description copied from interface: SampleManager
      Provides the human readable description.
      Specified by:
      getDescription in interface SampleManager
      Returns:
      the human readable description.
    • configure

      public void configure(Configuration configuration) throws ConfigurationException
      Specified by:
      configure in interface Configurable
      Throws:
      ConfigurationException
    • setPluginInfo

      public void setPluginInfo(String pluginName, String featureName, String id)
      Description copied from interface: PluginAware
      Sets the plugin info relative to the current component.
      Note : The feature name may be null if the targeted component in declared at plugin level.
      Specified by:
      setPluginInfo in interface PluginAware
      Parameters:
      pluginName - Unique identifier for the plugin hosting the extension
      featureName - Unique feature identifier (unique for a given pluginName)
      id - Unique identifier of this component
    • enableLogging

      public void enableLogging(Logger logger)
      Specified by:
      enableLogging in interface LogEnabled
    • configureRRDDef

      public void configureRRDDef(org.rrd4j.core.RrdDef rrdDef)
      Description copied from interface: SampleManager
      Provides the definition to use for this RRD file. Called only when the RRD file is about to be created.
      Specified by:
      configureRRDDef in interface SampleManager
      Parameters:
      rrdDef - the Round Robin Database definition.
    • _configureDatasources

      protected abstract void _configureDatasources(org.rrd4j.core.RrdDef rrdDef)
      Provides the data sources.
      Parameters:
      rrdDef - the Round Robin Database definition.
    • _registerDatasources

      protected void _registerDatasources(org.rrd4j.core.RrdDef rrdDef, String dsName, org.rrd4j.DsType dsType, double minValue, double maxValue)
      Register a new data source where heartbeat property is set internally.
      Parameters:
      rrdDef - the Round Robin Database definition.
      dsName - the data source name.
      dsType - the data source type.
      minValue - the minimal acceptable value. Use Double.NaN if unknown.
      maxValue - the maximal acceptable value. Use Double.NaN if unknown.
    • collect

      public Map<String,Object> collect(org.rrd4j.core.Sample sample) throws IOException
      Description copied from interface: SampleManager
      Collect data into the Round Robin Database.
      Specified by:
      collect in interface SampleManager
      Parameters:
      sample - the sample to collect.
      Returns:
      The collected values for each datasource name.
      Throws:
      IOException - thrown in case of I/O error.
    • _internalCollect

      protected abstract Map<String,Object> _internalCollect(org.rrd4j.core.Sample sample) throws IOException
      Collect data into the Round Robin Database.
      Parameters:
      sample - the sample to collect.
      Returns:
      The collected values for each datasource name.
      Throws:
      IOException - thrown in case of I/O error.
    • _setCommonParameters

      protected void _setCommonParameters(org.rrd4j.graph.RrdGraphDef graphDef)
      Set common graph definition parameters (graph style, ...)
      Parameters:
      graphDef - the prepared graph definition.
    • _configureValueRange

      protected void _configureValueRange(org.rrd4j.graph.RrdGraphDef graphDef)
      Configure the value range to be displayed.
      Default implementation set min value to 0.
      Parameters:
      graphDef - the graph definition.
    • _getGraphTitle

      protected abstract String _getGraphTitle()
      Provide the graph title.
      Returns:
      the graph title.