|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value={METHOD,CONSTRUCTOR}) public @interface Profiled
The Profiled annotation is used in concert with the log4j or javalog TimingAspects to enable unobtrusive performance logging. Methods with this annotation, when enabled with the TimingAspect, will automatically have their execution time logged.
Optional Element Summary | |
---|---|
boolean |
el
Whether or not the tag and message elements should support Java Expression Language syntax. |
String |
level
The level to use when logging the StopWatch. |
boolean |
logFailuresSeparately
Whether or not separate tags should be used depending on whether or not the annotated method returns normally or by throwing an exception. |
String |
logger
The name of the logger (either a log4J or java.logging Logger, depending on the Aspect in use at runtime) to use to log the StopWatch . |
String |
message
The optional message element can be used to set a message on the StopWatch that is logged. |
String |
tag
The tag that should be set on the StopWatch when the execution time is logged. |
public abstract String tag
StopWatch
when the execution time is logged. If not
specified then the name of the method being annotated will be used for the tag name.
public abstract String message
StopWatch
that is logged.
public abstract String logger
StopWatch
.
public abstract String level
public abstract boolean el
For example, suppose you want to profile the doGet() method of a servlet, with the tag name dependent on the name of the servlet AND the path info (as returned by getPathInfo()) of the request. You could create the following annotation:
@Profiled(tag = "servlet{$this.servletName}_{$0.pathInfo}", el = true) protected void doGet(HttpServletRequest req, HttpServletResponse res) { ... }If the doGet() method is called with a request whose getPathInfo() method returns "/sub/path", and the servlet's name if "main", then the tag used when logging a StopWatch will be "servletMain_/sub/path".
public abstract boolean logFailuresSeparately
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |