Class SystemResourceUsageServletContextListener

java.lang.Object
kieker.monitoring.probe.servlet.AbstractRegularSamplingServletContextListener
kieker.monitoring.probe.servlet.SystemResourceUsageServletContextListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.ServletContextListener

public class SystemResourceUsageServletContextListener
extends AbstractRegularSamplingServletContextListener

Starts and stops the periodic logging of various system resource samplers provided by the OshiSamplerFactory as the Servlet is initialized and destroyed respectively.
The initial delay and the sampling period (both given in seconds) can be configured via context-params in the web.xml file, as shown below. Note that the set of included samplers will be extended with new samplers becoming available in the OshiSamplerFactory.

The integration and configuration in a web.xml file works as follows:

  
  <web-app>
  ...

  <context-param>
   <param-name>SystemResourceUsageServletContextListener.samplingIntervalSeconds</param-name>
   <param-value>15</param-value>
  </context-param>

  <context-param>
   <param-name>SystemResourceUsageServletContextListener.initialSamplingDelaySeconds</param-name>
   <param-value>0</param-value>
  </context-param>

  <listener>
    <listener-class>
     kieker.monitoring.probe.servlet.SystemResourceUsageServletContextListener
    </listener-class>
  </listener>

 ...
 </web-app>
 }
 

Since:
1.12
Author:
Andre van Hoorn