else
comparator = new TimeComparator();
comparator.setDescending(true);
XmlWriter out = new XmlWriter(response.getWriter());
out.setStrategy(XmlWriter.HTML);
out.setIndenting(false);
out.println(
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
String contextPath = request.getContextPath();
if (contextPath == null || contextPath.length() == 0)
contextPath = "/";
String title = L.l("Profiling Results for {0}", contextPath);
out.startElement("html");
out.startElement("head");
out.writeElement("title", title);
out.startElement("style");
out.writeAttribute("type", "text/css");
out.println(
"h1 { background: #ccddff; margin : 0 -0.5em 0.25em -0.25em; padding: 0.25em 0.25em; }");
out.println(
"h2 { background: #ccddff; padding: 0.25em 0.5em; margin : 0.5em -0.5em; }");
out.println("table { border-collapse : collapse; }");
out.println("th { background : #c78ae6; border-left : 1px; border-right : 1px}");
out.println("tr { border-bottom : 1px dotted; }");
out.println(".number { text-align : right; }");
out.println("table table tr { border-bottom : none; }");
out.endElement("style");
out.endElement("head");
out.startElement("body");
out.writeElement("h1", title);
out.startElement("table");
out.writeAttribute("border", 0);
out.startElement("tr");
out.writeLineElement("th", L.l("Name"));
out.writeLineElement("th", L.l("Average Time"));
out.writeLineElement("th", L.l("Min Time"));
out.writeLineElement("th", L.l("Max Time"));
out.writeLineElement("th", L.l("Total Time"));
out.writeLineElement("th", L.l("Invocation Count"));
out.endElement("tr");
ProfilerPoint root = _profilerManager.getRoot();
List<ProfilerPoint> children = root.getChildren();
Collections.sort(children, comparator);
for (ProfilerPoint child : children)
display(child, comparator, out, 0);
out.endElement("table");
out.endElement("body");
out.endElement("html");
}