You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by sh...@apache.org on 2001/07/14 18:45:18 UTC
cvs commit: jakarta-taglibs/benchmark/xml benchmark.xml
shawn 01/07/14 09:45:18
Modified: benchmark build.xml
benchmark/examples/web benchmark1.jsp benchmark2.jsp
Added: benchmark/doc/web bench.html
benchmark/xml benchmark.xml
Log:
Updated 'benchmark' to use new documentation template.
Revision Changes Path
1.7 +1 -1 jakarta-taglibs/benchmark/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-taglibs/benchmark/build.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- build.xml 2001/07/08 16:13:29 1.6
+++ build.xml 2001/07/14 16:45:14 1.7
@@ -7,7 +7,7 @@
<project name="benchmark" default="main">
<property file="../build.properties"/>
- <property name="gen-docs.present" value="true"/>
+ <!-- <property name="gen-docs.present" value="true"/> -->
&common;
1.1 jakarta-taglibs/benchmark/doc/web/bench.html
Index: bench.html
===================================================================
<html>
<body bgcolor="#ffffff">
<h1>The "Benchmark" Tag Library</h1>
<h2>Introduction</h2>
<p>In dicussions about how best to design tag libraries, issues of
performance sometimes arise. The simple 'benchmark' tag library
should aid in the performance testing of other taglibs and JSP
pages in general. This library isn't a full-featured
benchmarking package. It's just a simple way to get rough
data if you want to sketch the relative performance of tags,
tag combinations, or arbitrary JSP fragments.</p>
<h2>Usage</h2>
<h3><code>duration</code></h3>
<pre>
<benchmark:duration> ... </benchmark:duration>
</pre>
<p>Calculates and prints the number of milliseconds taken (in
elapsed, "clock" time) to calculate its body. The number is
printed after the body. This tag can be enclosed by
<datetime:format> with an appropriate formatting string (i.e.,
just referring to hours, minutes, and seconds) to print out a
reasonably readable duration.</p>
<menu>
<table border="1" cellpadding="4">
<tr bgcolor="#000088">
<th><font color="white">Attribute</font></th>
<th><font color="white">Required?</font></th>
<th><font color="white">Description</font></th>
<th><font color="white">Default</font></th>
</tr>
<tr>
<td><b>repeat</b></td><td>optional</td><td>number of repetitions</td><td>1</td></tr>
<td><b>output</b></td><td>optional</td><td>if "true," the tag's body is
output</td><td>false<br />(output is hidden)</td></tr>
</table>
</menu>
</p>
<h3><code>exclude</code></h3>
<pre>
<benchmark:exclude> ... </benchmark:exclude>
</pre>
<p>Excludes its body from the overall benchmarking test. Some small
amount of time is necessary to process these tags
themselves, so they are not completely transparent. Nonetheless,
they may be useful for integrated timing of a subset of a compound
computation.</p>
<p><benchmark:exclude> effectively "pauses" the timer of its
nearest ancestor <benchmark:duration> tag while it runs.</p>
<h3>Example uses:</h3>
<pre>
<%-- Typically returns between 1000 - 1010 on my system. --%>
<benchmark:duration>
<% Thread.sleep(1000); %>
</benchmark:duration>
<%-- Typically returns about 1010 on my system. --%>
<benchmark:duration>
<% Thread.sleep(1000); %>
<benchmark:exclude>
<% Thread.sleep(1000); %>
</benchmark:exclude>
</benchmark:duration>
</pre>
<p>This isn't meant as a full-strength benchmarking package. It's just a
simple way to get rough performance data if you want to sketch the
performance of certain tags, tag combinations, or arbitrary JSP fragments.</p>
1.3 +1 -0 jakarta-taglibs/benchmark/examples/web/benchmark1.jsp
Index: benchmark1.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/benchmark/examples/web/benchmark1.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- benchmark1.jsp 2001/07/08 16:13:31 1.2
+++ benchmark1.jsp 2001/07/14 16:45:16 1.3
@@ -1,3 +1,4 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<%@ page session="false" %>
<%@ taglib uri="http://jakarta.apache.org/taglibs/benchmark" prefix="benchmark" %>
1.3 +1 -0 jakarta-taglibs/benchmark/examples/web/benchmark2.jsp
Index: benchmark2.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/benchmark/examples/web/benchmark2.jsp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- benchmark2.jsp 2001/07/08 16:13:31 1.2
+++ benchmark2.jsp 2001/07/14 16:45:17 1.3
@@ -1,3 +1,4 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<%@ page session="false" %>
<%@ taglib uri="http://jakarta.apache.org/taglibs/benchmark" prefix="benchmark" %>
1.1 jakarta-taglibs/benchmark/xml/benchmark.xml
Index: benchmark.xml
===================================================================
<?xml version="1.0" ?>
<document url="./benchmark.xml">
<!-- More properties can be added. Good place to stick loose
data needed elsewhere. -->
<properties>
<!-- The title here overrides the title generated by the
stylesheet for the documentation HTML <title> tag
<title>Jakarta Project: Benchmark JSP Tag Library</title>
-->
<!-- The name here is used in the HTML <meta name="author"...> tag -->
<author>Shawn Bayern</author>
</properties>
<!-- The following defines elements uses both to create the taglib
documentation and the tag library descriptor .tld file. The
elements used are those from the JSP 1.2 TLD DTD and special
elements used when creating the tagib documentation. Although
the JSP1.2 TLD DTD is used, this document can be used to
generate both a JSP 1.1 and a JSP 1.2 TLD.
-->
<taglib>
<!-- The following elements are from the JSP 1.2 TLD DTD -->
<!-- Version number of this tagib -->
<tlib-version>1.0</tlib-version>
<!-- Minimum version of JSP spec required -->
<jsp-version>1.1</jsp-version>
<!-- jakarta-taglib name of this tag library -->
<short-name>benchmark</short-name>
<!-- URI of taglib -->
<uri>http://jakarta.apache.org/taglibs/benchmark-1.0</uri>
<!-- The name to use in titles, etc. for the taglib -->
<display-name>Benchmark Tag library</display-name>
<!-- JSP 1.2 tag library DTD only, not used for generating
documentation.
<small-icon></small-icon>
<large-icon></large-icon>
-->
<!-- Used for generating Overview section of HTML documentation
and for the description element for a JSP 1.2 TLD.
Enter information here as straight XHTML paragraphs. Inside the
paragraphs regular XHTML can be used (but an external CSS is
encouraged). The information is copied into the generated HTML doc,
and the <p> elements are essential for that. -->
<description>
<p>A tag library that facilitates performance testing of other
tag libraries or JSP constructs.</p>
<p><font size="+1" color="#000099"> • <b>Note:</b> You can go <a
href="bench.html">here</a> for more lively
documentation. </font></p>
</description>
<!-- The following elements are for JSP 1.2 tag libraries only,
and are not used for generating documentation yet.
<validator>
<validator-class></validator-class>
<init-param>
<param-name></param-name>
<param-value></param-value>
<description></description>
</init-param>
<description></description>
</validator>
<listener>
<listener-class></listener-class>
</listener>
-->
<!-- The taglib-location is used to fill in the web.xml configuration
information in the HTML doc. -->
<taglib-location>/WEB-INF/benchmark.tld</taglib-location>
<!-- The prefix is used to fill in the taglib directive
configuration information in the HTML doc. -->
<prefix>benchmark</prefix>
<!-- This element must be straight text and is copied right into
the "Requirements" section of the HTML doc. -->
<requirements-info>
This custom tag library requires no software other than a servlet container
that supports the JavaServer Pages Specification, version 1.1 or higher.
</requirements-info>
<!-- The toc element allows the addition of document sections to
the Table of Contents list after the Tag Reference entry.
0 .. N sections can be added to the Table of Contents.
<toc href="test" name="Testing">
<p>This is a test of a TOC.</p>
</toc>
-->
<!-- The tagtoc element provides the ability to categorize the
tags in the tag library. There must be at least one tagtoc.
1 .. N tags can be nested within a tagtoc.
-->
<tagtoc name="Benchmark Tags">
<tag>
<name>duration</name>
<tag-class>org.apache.taglibs.benchmark.Duration</tag-class>
<!-- Optional TEI class
<tei-class>org.apache.taglibs.foo.fooTEI</tei-class>
-->
<body-content>jsp</body-content>
<!-- JSP 1.2, display name of tag -->
<display-name>duration</display-name>
<!-- JSP 1.2 tag library DTD only, not used for generating
documentation.
<small-icon></small-icon>
<large-icon></large-icon>
-->
<!-- Complete description of this tag. Used for JSP 1.2 TLD
and for generating HTML documentation. -->
<description>
Calculates and prints the number of milliseconds taken (in
elapsed, "clock" time) to calculate its body. The number is printed
after the body. As a hack, this tag can be enclosed by
<datetime:format> with an appropriate formatting string (i.e.,
just referring to hours, minutes, and seconds) to print out a
reasonably readable duration.
</description>
<!-- The next three non-standard elements are used to inform the relevant
sections of the HTML doc. See, for example, the Regexp
taglib docs for examples of the output. -->
<!-- One line summary of what tag does for Tag Summary section -->
<summary>Times its body</summary>
<!-- Version of taglib when this tag became available,
deprecated is a possible value. -->
<availability>1.0</availability>
<!-- Any restrictions on use of the tag -->
<restrictions>None</restrictions>
<!-- Declaration of scripting variables created by tag.
Used for generating HTML documentation and for
JSP 1.2 DTD. -->
<attribute>
<name>repeat</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>number of repetitions (default: 1)</description>
<!-- Used for the HTML documentation only.
Version of taglib when this attribute became available,
deprecated is a possible value. -->
<availability>1.0</availability>
</attribute>
<attribute>
<name>output</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
<description>if "true," the tag's body is output (default: false)</description>
<!-- Used for the HTML documentation only.
Version of taglib when this attribute became available,
deprecated is a possible value. -->
<availability>1.0</availability>
</attribute>
<!-- The entire example section is for usage examples that you want to
have added to the HTML doc under "Example" for each tag. The
example section is also included with a JSP 1.2 TLD. The
contents of these elements are rendered into a simple form of
syntax highlighting by the XSL sheet. Multiple usage sections
are allowed, and each will be display as a separate example
in the resultant HTML. -->
<example>
<usage>
<!-- Enter a JSP comment without the opening and closing tags.
Those will be added by the XSL. Put no HTML mark-up in here.
Currently, only one comment per usage section is supported. -->
<comment>
Typically returns between 1000 - 1010 on the author's system.
</comment>
<!-- The code element is for an example of using the tag. I
normally put these in CDATA sections so that the XSL
transform to HTML will turn the angle brackets into the
appropriate < and > entities automatically. Only
one code element per usage element is supported.
The resultant HTML is formatted and colorized. -->
<code>
<![CDATA[
<benchmark:duration>
<% Thread.sleep(1000); %>
</benchmark:duration>
]]>
</code>
</usage>
</example>
</tag>
<tag>
<name>exclude</name>
<tag-class>org.apache.taglibs.benchmark.Exclude</tag-class>
<body-content>jsp</body-content>
<!-- JSP 1.2, display name of tag -->
<display-name>duration</display-name>
<!-- JSP 1.2 tag library DTD only, not used for generating
documentation.
<small-icon></small-icon>
<large-icon></large-icon>
-->
<!-- Complete description of this tag. Used for JSP 1.2 TLD
and for generating HTML documentation. -->
<description>
Excludes its body from the overall benchmarking test. Some small
amount of time is necessary to process these tags
themselves, so they are not completely transparent. Nonetheless,
they may be useful for integrated timing of a subset of a compound
computation.
</description>
<!-- The next three non-standard elements are used to inform the relevant
sections of the HTML doc. See, for example, the Regexp
taglib docs for examples of the output. -->
<!-- One line summary of what tag does for Tag Summary section -->
<summary>Excludes its body from timer</summary>
<!-- Version of taglib when this tag became available,
deprecated is a possible value. -->
<availability>1.0</availability>
<!-- Any restrictions on use of the tag -->
<restrictions>None</restrictions>
<!-- The entire example section is for usage examples that you want to
have added to the HTML doc under "Example" for each tag. The
example section is also included with a JSP 1.2 TLD. The
contents of these elements are rendered into a simple form of
syntax highlighting by the XSL sheet. Multiple usage sections
are allowed, and each will be display as a separate example
in the resultant HTML. -->
<example>
<usage>
<!-- Enter a JSP comment without the opening and closing tags.
Those will be added by the XSL. Put no HTML mark-up in here.
Currently, only one comment per usage section is supported. -->
<comment>
Typically returns about 1010 on the author's system.
</comment>
<code>
<![CDATA[
<benchmark:duration>
<% Thread.sleep(1000); %>
<benchmark:exclude>
<% Thread.sleep(1000); %>
</benchmark:exclude>
</benchmark:duration>
]]>
</code>
</usage>
</example>
</tag>
</tagtoc>
</taglib>
<revision release="Pre-release" date="07/14/2001">
<description>
This is the first public release of the Benchmark taglib.
</description>
</revision>
</document>