Class MonitoringManager

  • All Implemented Interfaces:
    AlarmListener

    public class MonitoringManager
    extends TransactionalAlarmListener
    Monitoring class which saves site monitoring measures and events.
    Since:
    jcms-5.7
    Version:
    $Revision: 134877 $
    Author:
    Olivier Jaquemet
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String REVISION  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void generateAndSaveRandomEvent​(java.util.Date startDate, java.util.Date endDate)
      Method to be use for testing only, rename the existing monitoring file and generate fake events with random data.
      java.util.Date getLatestEventDate()
      Retrieve the latest (most recent) event Date.
      static MonitoringManager getMonitoringManager()
      Retrieve the MonitoringManager singleton (create it if it does not exists)
      java.util.Date getOldestEventDate()
      Retrieve the oldest event Date.
      long getRequestNbr()
      Retrieve the number of request counted in the measure interval
      void handleTransactionalAlarm​(AlarmEntry entry)
      TransactionalAlarmListener implementation.
      void monitorRequest​(javax.servlet.http.HttpServletRequest request)
      Methods to allow the Monitoring Manager to keep track of information about request (number of request).
      java.util.List<com.jalios.jcms.monitoring.Event> readEvents​(java.util.Date startDate, java.util.Date endDate)
      Read monitoring events previously saved.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getMonitoringManager

        public static MonitoringManager getMonitoringManager()
        Retrieve the MonitoringManager singleton (create it if it does not exists)
        Returns:
        the MonitoringManager singleton
      • 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 java.util.Date getOldestEventDate()
        Retrieve the oldest event Date.
        Returns:
        the oldest event Date
      • getLatestEventDate

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

        public java.util.List<com.jalios.jcms.monitoring.Event> readEvents​(java.util.Date startDate,
                                                                           java.util.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​(java.util.Date startDate,
                                               java.util.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