Class DetailedStatsCollector

java.lang.Object
org.eso.ias.plugin.DetailedStatsCollector

public class DetailedStatsCollector extends Object
Collects detailed statistics about updated of monitor point values.

This objects is notified about every monitor point update received by the plugin from the monitored system..
When requested, the plugin submits a log with the statistics collected so far and get ready for the next time interval where a time interval is whatever time is between two consecutive calls of getAndReset().

If there has been no update in the last time interval, no message is logged.

Author:
acaproni
  • Field Details

    • MONITOR_POINTS_TO_LOG

      public static final int MONITOR_POINTS_TO_LOG
      The number of monitor points to log
      See Also:
    • logger

      public static final org.slf4j.Logger logger
      The logger
  • Constructor Details

    • DetailedStatsCollector

      public DetailedStatsCollector()
  • Method Details

    • mPointUpdated

      public void mPointUpdated(String id)
      A monitor point with the given ID has been update
      Parameters:
      id - The not null nor empty ID of the updated monitor point
    • getAndReset

      public List<DetailedStatsCollector.StatData> getAndReset()
      Get the 10 most frequently updated monitor points
      Returns:
      The most frequently update monitor points (sorted ascending); empty if no monitor point has been updated in the time interval
    • logAndReset

      public String logAndReset()
      Logs the message and get ready for the next iteration period.
      Returns:
      The logged message or null if the list of occurrences is empty.