@Retention(value=RUNTIME) @Target(value={METHOD,CONSTRUCTOR}) public @interface Profiled
Modifier and Type | Fields and Description |
---|---|
static String |
DEFAULT_TAG_NAME |
static String |
THRESHOLD_FIELD_NAME |
Modifier and Type | Optional Element and Description |
---|---|
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. |
boolean |
normalAndSlowSuffixesEnabled
Default is false.
|
String |
tag
The tag that should be set on the
StopWatch when the execution time is logged. |
long |
timeThreshold
If the timeThreshold is set to a positive value, then the method execution time will be logged only if took
more than timeThreshold milliseconds.
|
public static final String DEFAULT_TAG_NAME
public static final String THRESHOLD_FIELD_NAME
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
public abstract long timeThreshold
Copyright © 2008–2015 jperf. All rights reserved.