Package com.jalios.jcms.monitoring
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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenerateAndSaveRandomEvent(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.DategetLatestEventDate()Retrieve the latest (most recent) event Date.static MonitoringManagergetMonitoringManager()Retrieve the MonitoringManager singleton (create it if it does not exists)java.util.DategetOldestEventDate()Retrieve the oldest event Date.longgetRequestNbr()Retrieve the number of request counted in the measure intervalvoidhandleTransactionalAlarm(AlarmEntry entry)TransactionalAlarmListener implementation.voidmonitorRequest(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 com.jalios.jcms.db.TransactionalAlarmListener
handleAlarm
-
-
-
-
Method Detail
-
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:
handleTransactionalAlarmin classTransactionalAlarmListener- 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 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 generationendDate- the ending date to use for Event generation- Since:
- jcms-5.7
-
-