org.perf4j.log4j.servlet
Class GraphingServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.perf4j.servlet.AbstractGraphingServlet
              extended by org.perf4j.log4j.servlet.GraphingServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class GraphingServlet
extends AbstractGraphingServlet

This graphing servlet implementation looks for graphs from GraphingStatisticsAppenders that have been created by the log4j framework. Thus, in order to add live performance graphs to a web application, you should first create the necessary GraphingStatisticsAppenders in your log4j.xml config file. Then, you should create an instance of this servlet in your web.xml file and set a "graphNames" init parameter to be a comma-separated list of the appender names whose graphs you wish to display.

Author:
Alex Devine
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.perf4j.servlet.AbstractGraphingServlet
graphNames
 
Constructor Summary
GraphingServlet()
           
 
Method Summary
protected  List<String> getAllKnownGraphNames()
          This method looks for all known GraphingStatisticsAppenders and returns their names.
protected  StatisticsChartGenerator getGraphByName(String name)
          Finds the specified graph by using the GraphingStatisticsAppender.getAppenderByName(String) method to find the appender with the specified name.
 
Methods inherited from class org.perf4j.servlet.AbstractGraphingServlet
destroy, doGet, doPost, getChartGeneratorsToDisplay, init, writeChart, writeFooter, writeHeader
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphingServlet

public GraphingServlet()
Method Detail

getGraphByName

protected StatisticsChartGenerator getGraphByName(String name)
Finds the specified graph by using the GraphingStatisticsAppender.getAppenderByName(String) method to find the appender with the specified name.

Specified by:
getGraphByName in class AbstractGraphingServlet
Parameters:
name - the name of the GraphingStatisticsAppender whose chart generator should be returned.
Returns:
The specified chart generator, or null if no appender with the specified name was found.

getAllKnownGraphNames

protected List<String> getAllKnownGraphNames()
This method looks for all known GraphingStatisticsAppenders and returns their names.

Specified by:
getAllKnownGraphNames in class AbstractGraphingServlet
Returns:
The list of known GraphingStatisticsAppender names.


Copyright © 2008-2011 perf4j.org. All Rights Reserved.