Custom JSP taglib. Lets you measure execution time for
your JSP code and use calculated data in your algorithms. For example:
<calc:recordTime label="A" log="logfile.txt">
<!-- some JSP code -->
</calc:recordTime>
in this case tag records execution time for wrapped code fragment. You may
examine later recorded time (for example to change on the fly your algorithm,
do some redirection, include cache etc.):
So you may request minimal, maximal and average time for the labeled code fragment (it could be the whole page of course). And any value could be examined in two forms: local view for current session or global view for all users.
Log file lets you proceed data with some statistical package. It is a text
file with tab separated fields. Record format is:
Tags are:
recordTime
Body tag. Executes own body and calculates execution time. Parameters are:
1) label unique label (ID) for code fragment
2) log Optional parameter. Describes a
name for the file where profile will be saved.
getMinTime
Returns minimal time for the given fragment. Parameters are:
1) label fragment's label
2) scope Optional parameter. Describes
a scope for your measurement. Possible values are session or application.
Default value is application.
3) id Optional parameter. Describes a name for
page scope variable (type is java.lang.Long) for data. Without this parameter tag just prints data.
getMaxTime
Returns maximal time for the given fragment. Parameters are:
1) label fragment's label
2) scope Optional parameter. Describes
a scope for your measurement. Possible values are session or application.
Default value is application.
3) id Optional parameter. Describes a name for
page scope variable (type is java.lang.Long) for data. Without this parameter tag just prints data.
getAvgTime
Returns average time for the given fragment. Parameters are:
1) label fragment's label
2) scope Optional parameter. Describes
a scope for your measurement. Possible values are session or application.
Default value is application.
3) id Optional parameter. Describes a name for
page scope variable (type is java.lang.Long) for data. Without this parameter tag just prints data.
for downloading:
Library: proftag.jar Description: taglib.tld
See also Coldtags suite - the largest collection of custom JSP tags.