|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.extensions.surf.site.Timer
public class Timer
A class that provides facilities for keeping track of the rendering times of components, regions, templates and pages. The framework will call into this class when execution of said pieces. If it is not enabled, then these calls will just NOP. Otherwise, they will log using the Framework logger.
Field Summary | |
---|---|
protected List<String> |
keys
|
protected static org.apache.commons.logging.Log |
logger
|
protected Map<String,Long> |
startTimes
|
protected static String |
TIMER_KEY
|
protected Map<String,Long> |
totalTimes
|
Constructor Summary | |
---|---|
Timer()
|
Method Summary | |
---|---|
static void |
bindTimer(javax.servlet.ServletRequest request)
Binds a timer container to the current context This must be called at the top of the request execution chain |
static void |
bindTimer(javax.servlet.ServletRequest request,
boolean forceNew)
|
static boolean |
isTimerEnabled()
Determines whether the timer is enabled. |
protected static void |
print(String value)
Either print out to the configured Timer logger Or if they haven't set that up, just dump out to console |
static void |
report(javax.servlet.ServletRequest request,
String blockId)
Writes to debug out the report for a single block id |
static void |
reportAll(javax.servlet.ServletRequest request)
|
protected static boolean |
showMilliseconds()
|
static void |
start(RenderContext context,
String blockId)
|
static void |
start(javax.servlet.ServletRequest request,
String blockId)
Begins timing for a specific block. |
static void |
stop(RenderContext context,
String blockId)
|
static void |
stop(javax.servlet.ServletRequest request,
String blockId)
|
static void |
unbindTimer(javax.servlet.ServletRequest request)
Releases the timer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static String TIMER_KEY
protected static org.apache.commons.logging.Log logger
protected Map<String,Long> totalTimes
protected Map<String,Long> startTimes
protected List<String> keys
Constructor Detail |
---|
public Timer()
Method Detail |
---|
protected static void print(String value)
public static boolean isTimerEnabled()
protected static boolean showMilliseconds()
public static void bindTimer(javax.servlet.ServletRequest request)
context
- The current request contextpublic static void bindTimer(javax.servlet.ServletRequest request, boolean forceNew)
public static void unbindTimer(javax.servlet.ServletRequest request)
context
- The current request contextpublic static void start(RenderContext context, String blockId)
public static void start(javax.servlet.ServletRequest request, String blockId)
context
- The current request contextblockId
- The unique id of the blockpublic static void stop(RenderContext context, String blockId)
public static void stop(javax.servlet.ServletRequest request, String blockId)
public static void report(javax.servlet.ServletRequest request, String blockId)
context
- The current request contextblockId
- The block id to report onpublic static void reportAll(javax.servlet.ServletRequest request)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |