Class MonitoringManager

java.lang.Object
com.jalios.jcms.db.TransactionalAlarmListener
com.jalios.jcms.monitoring.MonitoringManager
All Implemented Interfaces:
AlarmListener

public class MonitoringManager extends TransactionalAlarmListener
Monitoring class which saves site monitoring measures and events.
Since:
jcms-5.7
Author:
Olivier Jaquemet
  • Method Details

    • getMonitoringManager

      public static MonitoringManager getMonitoringManager()
      Retrieve the MonitoringManager singleton (create it if it does not exists)
      Returns:
      the MonitoringManager singleton
    • handleTransactionalAlarm

      public void handleTransactionalAlarm(AlarmEntry entry)
      TransactionalAlarmListener implementation.
      Specified by:
      handleTransactionalAlarm in class TransactionalAlarmListener
      Parameters:
      entry - the AlarmEntry which has been triggered.
      Since:
      jcms-6.0
    • monitorRequest

      public void monitorRequest(javax.servlet.http.HttpServletRequest request)
      Methods to allow the Monitoring Manager to keep track of information about request (number of request). This method is called by the InitFilter each time a request is processed.
      Parameters:
      request - the request to count
    • getRequestNbr

      public long getRequestNbr()
      Retrieve the number of request counted in the measure interval
      Returns:
      the current request number
    • getOldestEventDate

      public Date getOldestEventDate()
      Retrieve the oldest event Date.
      Returns:
      the oldest event Date
    • getLatestEventDate

      public Date getLatestEventDate()
      Retrieve the latest (most recent) event Date.
      Returns:
      the latest (most revent) event Date
    • readEvents

      public List<com.jalios.jcms.monitoring.Event> readEvents(Date startDate, Date endDate)
      Read monitoring events previously saved.
      Parameters:
      startDate - the starting Date below which events are not read, if null, it is not used.
      endDate - the ending Date above which events are not read, if null, it is not used.
      Returns:
      a List of Measure, in the order they were read
      Since:
      jcms-5.7
    • generateAndSaveRandomEvent

      public void generateAndSaveRandomEvent(Date startDate, Date endDate)
      Method to be use for testing only, rename the existing monitoring file and generate fake events with random data.
      Parameters:
      startDate - the starting date to use for Event generation
      endDate - the ending date to use for Event generation
      Since:
      jcms-5.7