1
0
mirror of https://github.com/octoleo/plantuml-server.git synced 2024-12-30 11:30:35 +00:00

[FEATURE] Add JSP/CSS/JS needed for stats

This commit is contained in:
Arnaud 2013-12-17 19:22:27 +01:00
parent 0cfaaf9bbc
commit 1282c1e523
7 changed files with 1057 additions and 43 deletions

View File

@ -1,19 +1,36 @@
<%@ page info="index" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<c:set var="contextroot" value="${pageContext.request.contextPath}" />
<c:set var="hostpath" value="http://${pageContext.request.serverName}:${pageContext.request.serverPort}${contextroot}" />
<c:if test="${pageContext.request.serverPort == 80 }">
<c:set var="hostpath" value="http://${pageContext.request.serverName}${contextroot}" />
</c:if>
<c:if test="${!empty encoded}">
<c:set var="imgurl" value="${hostpath}/img/${encoded}" />
<c:set var="svgurl" value="${hostpath}/svg/${encoded}" />
<c:set var="txturl" value="${hostpath}/txt/${encoded}" />
<c:if test="${!empty mapneeded}">
<c:set var="mapurl" value="${hostpath}/map/${encoded}" />
</c:if>
</c:if>
<%
long date0 = System.currentTimeMillis();
String token = net.sourceforge.plantuml.pstat.Stats.getInstance().getNewToken(date0);
String contextRoot = request.getContextPath();
String host = "http://" + request.getServerName() + ":" + request.getServerPort();
String encoded = "";
String umltext = "";
String imgurl = "";
String svgurl = "";
String txturl = "";
String mapurl = "";
Object mapNeeded = request.getAttribute("net.sourceforge.plantuml.servlet.mapneeded");
Object encodedAttribute = request.getAttribute("net.sourceforge.plantuml.servlet.encoded");
if (encodedAttribute != null) {
encoded = encodedAttribute.toString();
if (!encoded.isEmpty()) {
imgurl = host + contextRoot + "/img/" + encoded;
svgurl = host + contextRoot + "/svg/" + encoded;
txturl = host + contextRoot + "/txt/" + encoded;
if (mapNeeded != null) {
mapurl = host + contextRoot + "/map/" + encoded;
}
}
}
Object decodedAttribute = request.getAttribute("net.sourceforge.plantuml.servlet.decoded");
if (decodedAttribute != null) {
umltext = decodedAttribute.toString();
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
@ -22,58 +39,272 @@
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache, must-revalidate" />
<link rel="stylesheet" href="${contextroot}/plantuml.css" type="text/css"/>
<link rel="icon" href="${contextroot}/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="${contextroot}/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" href="<%=contextRoot %>/plantuml002.css" type="text/css"/>
<link rel="icon" href="<%=contextRoot %>/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="<%=contextRoot %>/favicon.ico" type="image/x-icon"/>
<title>PlantUMLServer</title>
<!-- page load timer -->
<script type='text/javascript'>
var starttime = new Date().getTime();
function getXMLHttpRequest()
{
if (window.XMLHttpRequest) {
return new window.XMLHttpRequest;
}
else {
try {
return new ActiveXObject("MSXML2.XMLHTTP.3.0");
}
catch(ex) {
return null;
}
}
}
function wndwidth(){
var w = 0;
//IE
if(!window.innerWidth){
if(!(document.documentElement.clientWidth == 0)){
//strict mode
w = document.documentElement.clientWidth;
} else{
//quirks mode
w = document.body.clientWidth;
}
} else {
//w3c
w = window.innerWidth;
}
return w
}
function wndheight(){
var h = 0;
//IE
if(!window.innerHeight){
if(!(document.documentElement.clientHeight == 0)){
//strict mode
h = document.documentElement.clientHeight;
} else{
//quirks mode
h = document.body.clientHeight;
}
} else {
//w3c
h = window.innerHeight;
}
return h;
}
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-16629806-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div id="header">
<%-- PAGE TITLE --%>
<h1>PlantUML Server</h1>
<p>This application provides a servlet which serves images created by <a href="http://plantuml.sourceforge.net">PlantUML</a>.</p>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- pstat2 -->
<ins class="adsbygoogle"
style="display:inline-block;width:970px;height:90px"
data-ad-client="ca-pub-5770515425712095"
data-ad-slot="9727170700"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td width="150">
<div id="sidesoc1">
<script type="text/javascript">
/* <![CDATA[ */
(function() {
var s = document.createElement('script'), t = document.getElementsByTagName('script')[0];
s.type = 'text/javascript';
s.async = true;
s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
t.parentNode.insertBefore(s, t);
})();
/* ]]> */</script>
<a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://plantuml.sourceforge.net/"></a>
</div>
</td>
<td width="150">
<div id="sidesoc2">
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share" data-url="http://plantuml.sourceforge.net" data-counter="right"></script>
</div>
</td>
<td width="150">
<div id="sidesoc3">
<a href='https://twitter.com/share' class='twitter-share-button' data-lang='en' data-url='http://plantuml.sourceforge.net'
data-text='Trying PlantUML' data-count='horizontal' data-size='medium'></a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document,'script','twitter-wjs');</script>
</div>
</td>
<td width="150">
<div id="sidesoc4">
<div id='fb-root'></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = '//connect.facebook.net/en_US/all.js#xfbml=1';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class='fb-like' data-href='http://plantuml.sourceforge.net' data-send='false' data-layout='button_count' data-width='110' data-show-faces='false'></div>
</div>
</td>
<td width="150">
<div id="sidesoc5">
<div class='g-plusone' data-href='http://plantuml.sourceforge.net' data-size='medium' data-annotation='bubble' ></div>
<script>
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</div>
</td>
</tr>
</table>
<p>This application provides a servlet which serves images created by <a href="http://plantuml.sourceforge.net">PlantUML</a>.<br>
(Check <a href=log.jsp>detailed site logs here</a>.)</p>
</div>
<div id="content">
<%-- CONTENT --%>
<form method="post" accept-charset="UTF-8" action="${contextroot}/form">
<form method="post" accept-charset="UTF-8" action="<%=contextRoot %>/form">
<p>
<textarea name="text" cols="120" rows="10"><c:out value="${decoded}"/></textarea>
<textarea name="text" cols="120" rows="10"><%=umltext %></textarea>
<br/>
<input type="submit" />
</p>
</form>
<hr/>
You can enter here a previously generated URL:
<form method="post" action="${contextroot}/form">
<form method="post" action="<%=contextRoot %>/form">
<p>
<input name="url" type="text" size="150" value="${imgurl}" />
<input name="url" type="text" size="150" value="<%=imgurl %>" />
<br/>
<input type="submit"/>
</p>
</form>
<c:if test="${!empty imgurl}">
<hr/>
<a href="${svgurl}">View as SVG</a>&nbsp;
<a href="${txturl}">View as ASCII Art</a>&nbsp;
<c:if test="${!empty mapurl}">
<a href="${mapurl}">View Map Data</a>
</c:if>
<p id="diagram">
<c:choose>
<c:when test="${!empty mapurl}">
<img src="${imgurl}" alt="PlantUML diagram" usemap="#umlmap" />
<map name="umlmap">
<c:import url="${mapurl}" />
</map>
</c:when>
<c:otherwise>
<img src="${imgurl}" alt="PlantUML diagram" />
</c:otherwise>
</c:choose>
</p>
</c:if>
<% if ( !imgurl.isEmpty()) { %>
<hr/>
<a href="<%=svgurl%>">View as SVG</a>&nbsp;
<a href="<%=txturl%>">View as ASCII Art</a>
<% if (mapNeeded != null) { %>
<a href="<%=mapurl%>">View Map Data</a>
<% } //endif %>
<% if (!encoded.isEmpty()) { %>
<p align=center>
<a href="//www.pinterest.com/pin/create/button/?url=http%3A%2F%2Fplantuml.sourceforge.net%2F&media=http%3A%2F%2Fwww.plantuml.com%2Fplantuml%2Fimg%2F<%=encoded %>&description=PlantUML"
data-pin-do="buttonPin" data-pin-config="none"><img border=0 src="//assets.pinterest.com/images/pidgets/pin_it_button.png" /></a>
</p>
<% } //endif %>
<script>
function doneLoading() {
var loadtime = new Date().getTime();
var loadduration = loadtime - starttime;
document.getElementById('loadtime2').innerHTML = 'image loaded in '+ loadduration +' ms';
var r1 = getXMLHttpRequest();
if (r1 != null) {
r1.open("GET", "/plantuml/sx1?t=<%=token %>&s="+starttime+"&i="+loadtime+"&w="+wndwidth()+"&h="+wndheight(), true);
r1.send();
}
};
</script>
<p id="diagram">
<% if (mapNeeded != null) { %>
<img src="<%=imgurl %>" alt="PlantUML diagram" usemap="#umlmap" onload="doneLoading()" />
<map name="umlmap">
<c:import url="<%=mapurl %>" />
</map>
<% } else { %>
<img src="<%=imgurl %>" alt="PlantUML diagram" onload="doneLoading()" />
<% } %>
</p>
<% } //endif %>
</div>
<div id="side2">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- ServletSkyscraper1 -->
<ins class="adsbygoogle"
style="display:inline-block;width:160px;height:600px"
data-ad-client="ca-pub-5770515425712095"
data-ad-slot="9576384701"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
<!-- This comment is used by the TestProxy class
@startuml
Bob -> Alice : hello
@enduml
-->
<div id="loading">(<i id="loadtime0"></i>&nbsp;/&nbsp;<i id="loadtime1"></i>&nbsp;/&nbsp;<i id="loadtime2"></i>)</div>
<%-- FOOTER --%>
<%@ include file="footer.jspf" %>
<!-- Start of StatCounter Code for Default Guide -->
<script type="text/javascript">
var sc_project=9301480;
var sc_invisible=1;
var sc_security="6eff847c";
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type='text/javascript' src='" +
scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>
<noscript><div class="statcounter"><a title="web analytics"
href="http://statcounter.com/" target="_blank"><img
class="statcounter"
src="http://c.statcounter.com/9301480/0/6eff847c/1/"
alt="web analytics"></a></div></noscript>
<!-- End of StatCounter Code for Default Guide -->
<!-- page load timer start -->
<script type='text/javascript'>
var endtime = new Date().getTime();
var endduration = endtime - starttime;
document.getElementById('loadtime1').innerHTML = 'page loaded in '+ endduration +' ms';
<%long date1 = System.currentTimeMillis()+10;
long duration = date1 - date0;
net.sourceforge.plantuml.pstat.Stats.getInstance().logHtmlCreate(token, date0, date1, encoded, request);%>
document.getElementById('loadtime0').innerHTML = 'Page generated in <%=duration%> ms';
var r2 = getXMLHttpRequest();
if (r2 != null) {
r2.open("GET", "/plantuml/sx1?t=<%=token %>&s="+starttime+"&p="+endtime+"&w="+wndwidth()+"&h="+wndheight() , true);
r2.send();
}
</script>
<!-- page load timer end -->
</body>
</html>

366
src/main/webapp/log.jsp Normal file
View File

@ -0,0 +1,366 @@
<%@ page info="index" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="false" %>
<%
String contextRoot = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache, must-revalidate" />
<link rel="icon" href="<%=contextRoot %>/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="<%=contextRoot %>/favicon.ico" type="image/x-icon"/>
<!-- SimpleTabs -->
<link rel="stylesheet" media="screen" type="text/css" href="<%=contextRoot %>/simpletabs.css" />
<script type="text/javascript" src="<%=contextRoot %>/simpletabs_1.3.packed.js"></script>
<title>PlantUML logs</title>
</head>
<body>
<center><h2>PlantUML site logs</h2>
<p>Back to the <a href=/plantuml>server home page.</a></p>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- pstat1 -->
<ins class="adsbygoogle"
style="display:inline-block;width:970px;height:90px"
data-ad-client="ca-pub-5770515425712095"
data-ad-slot="1822127509"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td width="150">
<div id="sidesoc1">
<script type="text/javascript">
/* <![CDATA[ */
(function() {
var s = document.createElement('script'), t = document.getElementsByTagName('script')[0];
s.type = 'text/javascript';
s.async = true;
s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
t.parentNode.insertBefore(s, t);
})();
/* ]]> */</script>
<a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://plantuml.sourceforge.net/"></a>
</div>
</td>
<td width="150">
<div id="sidesoc2">
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share" data-url="http://plantuml.sourceforge.net" data-counter="right"></script>
</div>
</td>
<td width="150">
<div id="sidesoc3">
<a href='https://twitter.com/share' class='twitter-share-button' data-lang='en' data-url='http://plantuml.sourceforge.net'
data-text='Trying PlantUML' data-count='horizontal' data-size='medium'></a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document,'script','twitter-wjs');</script>
</div>
</td>
<td width="150">
<div id="sidesoc4">
<div id='fb-root'></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = '//connect.facebook.net/en_US/all.js#xfbml=1';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class='fb-like' data-href='http://plantuml.sourceforge.net' data-send='false' data-layout='button_count' data-width='110' data-show-faces='false'></div>
</div>
</td>
<td width="150">
<div id="sidesoc5">
<div class='g-plusone' data-href='http://plantuml.sourceforge.net' data-size='medium' data-annotation='bubble' ></div>
<script>
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</div>
</td>
</tr>
</table>
</center>
<%
if (net.sourceforge.plantuml.pstat.Stats.USE_STATS) {
net.sourceforge.plantuml.pstat.tick.GraphData gd = net.sourceforge.plantuml.pstat.Stats.getInstance().getGraphData();
%>
<div class="simpleTabs">
<ul class="simpleTabsNavigation">
<li><a href="#">Last 10 minutes</a></li>
<li><a href="#">Last 60 minutes</a></li>
<li><a href="#">Last 48 hours</a></li>
<li><a href="#">Last 15 days</a></li>
<li><a href="#">Last 24 months</a></li>
</ul>
<div class="simpleTabsContent">
<!-- 10 ------------------------ -->
<h3>Diagrams per minutes</h3>
<% gd.hminutes10().getHistogramBuilder().getHistogram(200, 30, 12).printSvg(out); %>
<table border=0 cellspacing=0 cellpadding=6>
<tr>
<td>
<h3>Image Server Generation</h3>
<% gd.hminutes10().getChartImageGeneration(150).printSvg(out); %>
</td>
<td>
<h3>Diagrams generated</h3>
<% gd.minutes10().getChartType(150).printSvg(out); %>
</td>
</tr>
<tr>
<td>
<h3>Page Load</h3>
<% gd.bminutes10().getChartPageLoad(150).printSvg(out); %>
</td>
<td>
<h3>Image Load</h3>
<% gd.bminutes10().getChartImageLoad(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Browser</h3>
<% gd.minutes10().getChartBrowser(150).printSvg(out); %>
</td>
<td valign=top>
<h3>Operation System</h3>
<% gd.minutes10().getChartOperationSystem(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Site using image generation</h3>
<% gd.minutes10().getChartIncomming(150).printSvg(out); %>
</td>
</tr>
</table>
<h3>Country & Language</h3>
<table border=0 cellspacing=0 cellpadding=6 valign=top>
<tr valign=top>
<td valign=top>
<% gd.minutes10().getHistoListCountry(400, 20, 12).printSvg(out); %>
</td>
<td valign=top>
<% gd.minutes10().getChartLanguage(150).printSvg(out); %>
</td>
</tr>
</table>
<!-- 10 ------------------------ -->
</div>
<div class="simpleTabsContent">
<!-- 60 ------------------------ -->
<h3>Diagrams per minutes</h3>
<% gd.hminutes60().getHistogramBuilder().getHistogram(200, 18, 12).printSvg(out); %>
<table border=0 cellspacing=0 cellpadding=6>
<tr>
<td>
<h3>Image Server Generation</h3>
<% gd.hminutes60().getChartImageGeneration(150).printSvg(out); %>
</td>
<td>
<h3>Diagrams generated</h3>
<% gd.minutes60().getChartType(150).printSvg(out); %>
</td>
</tr>
<tr>
<td>
<h3>Page Load</h3>
<% gd.bminutes60().getChartPageLoad(150).printSvg(out); %>
</td>
<td>
<h3>Image Load</h3>
<% gd.bminutes60().getChartImageLoad(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Browser</h3>
<% gd.minutes60().getChartBrowser(150).printSvg(out); %>
</td>
<td valign=top>
<h3>Operation System</h3>
<% gd.minutes60().getChartOperationSystem(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Site using image generation</h3>
<% gd.minutes60().getChartIncomming(150).printSvg(out); %>
</td>
</tr>
</table>
<h3>Country & Language</h3>
<table border=0 cellspacing=0 cellpadding=6 valign=top>
<tr valign=top>
<td valign=top>
<% gd.minutes60().getHistoListCountry(400, 20, 12).printSvg(out); %>
</td>
<td valign=top>
<% gd.minutes60().getChartLanguage(150).printSvg(out); %>
</td>
</tr>
</table>
<!-- 60 ------------------------ -->
</div>
<div class="simpleTabsContent">
<!-- 48 ------------------------ -->
<h3>Diagrams per hour</h3>
<% gd.hhours48().getHistogramBuilder().getHistogram(200, 22, 12).printSvg(out); %>
<table border=0 cellspacing=0 cellpadding=6>
<tr>
<td>
<h3>Image Server Generation</h3>
<% gd.hhours48().getChartImageGeneration(150).printSvg(out); %>
</td>
<td>
<h3>Diagrams generated</h3>
<% gd.hours48().getChartType(150).printSvg(out); %>
</td>
</tr>
<tr>
<td>
<h3>Page Load</h3>
<% gd.bhours48().getChartPageLoad(150).printSvg(out); %>
</td>
<td>
<h3>Image Load</h3>
<% gd.bhours48().getChartImageLoad(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Browser</h3>
<% gd.hours48().getChartBrowser(150).printSvg(out); %>
</td>
<td valign=top>
<h3>Operation System</h3>
<% gd.hours48().getChartOperationSystem(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Site using image generation</h3>
<% gd.hours48().getChartIncomming(150).printSvg(out); %>
</td>
</tr>
</table>
<h3>Country & Language</h3>
<table border=0 cellspacing=0 cellpadding=6 valign=top>
<tr valign=top>
<td valign=top>
<% gd.hours48().getHistoListCountry(400, 20, 12).printSvg(out); %>
</td>
<td valign=top>
<% gd.hours48().getChartLanguage(150).printSvg(out); %>
</td>
</tr>
</table>
<!-- 48 ------------------------ -->
</div>
<div class="simpleTabsContent">
<!-- 15 ------------------------ -->
<h3>Diagrams per day</h3>
<% gd.hdays15().getHistogramBuilder().getHistogram(200, 50, 12).printSvg(out); %>
<table border=0 cellspacing=0 cellpadding=6>
<tr>
<td>
<h3>Image Server Generation</h3>
<% gd.hdays15().getChartImageGeneration(150).printSvg(out); %>
</td>
<td>
<h3>Diagrams generated</h3>
<% gd.days15().getChartType(150).printSvg(out); %>
</td>
</tr>
<tr>
<td>
<h3>Page Load</h3>
<% gd.bdays15().getChartPageLoad(150).printSvg(out); %>
</td>
<td>
<h3>Image Load</h3>
<% gd.bdays15().getChartImageLoad(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Browser</h3>
<% gd.days15().getChartBrowser(150).printSvg(out); %>
</td>
<td valign=top>
<h3>Operation System</h3>
<% gd.days15().getChartOperationSystem(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Site using image generation</h3>
<% gd.days15().getChartIncomming(150).printSvg(out); %>
</td>
</tr>
</table>
<h3>Country & Language</h3>
<table border=0 cellspacing=0 cellpadding=6 valign=top>
<tr valign=top>
<td valign=top>
<% gd.days15().getHistoListCountry(400, 20, 12).printSvg(out); %>
</td>
<td valign=top>
<% gd.days15().getChartLanguage(150).printSvg(out); %>
</td>
</tr>
</table>
<!-- 15 ------------------------ -->
</div>
<div class="simpleTabsContent">
<!-- 31 ------------------------ -->
<h3>Diagrams per month</h3>
<%
net.sourceforge.plantuml.pstat.tick.GraphDataLongTerm gdl = net.sourceforge.plantuml.pstat.Stats.getInstance().getGraphDataLongTerm();
gdl.getHistogramBuilder().getHistogram(400, 40, 12).printSvg(out);
%>
<!-- 31 ------------------------ -->
</div>
</div>
<%
}
%>
</body>
</html>

View File

@ -0,0 +1,31 @@
<%@ page info="index" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="false" %>
<%
String contextRoot = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache, must-revalidate" />
<link rel="icon" href="<%=contextRoot %>/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="<%=contextRoot %>/favicon.ico" type="image/x-icon"/>
<!-- SimpleTabs -->
<link rel="stylesheet" media="screen" type="text/css" href="<%=contextRoot %>/simpletabs.css" />
<script type="text/javascript" src="<%=contextRoot %>/simpletabs_1.3.packed.js"></script>
<title>PlantUML memory</title>
</head>
<body>
<h3>Memory</h3>
<% net.sourceforge.plantuml.pstat.Stats.getInstance().memories(200, 12, 12).printSvg(out); %>
<p><hr>
<h3>Threads</h3>
<% net.sourceforge.plantuml.pstat.Stats.getInstance().threads(200, 12, 12).printSvg(out); %>
</body>
</html>

View File

@ -0,0 +1,75 @@
/******************************
* PlantUMLServlet style sheet *
******************************/
/* Font */
* {
font-family: arial,helvetica,sans-serif;
}
/* Header */
#header {
margin-left: 170px;
margin-right: 5px;
text-align: center;
}
/* Content */
#content {
margin-left: 170px;
margin-right: 5px;
}
/* Form inputs */
#content textarea, #content input[type=text] {
background-color: #ffc;
font-family: monospace;
width: 100%;
}
/* XHTML tag */
#content code {
font-family: 'courier new',courier,monospace;
letter-spacing: -1pt;
}
/* Diagram */
#content #diagram {
text-align: center;
}
#content #diagram img {
border: medium solid green;
padding: 10px;
}
/* Footer */
#footer p {
margin-left: 170px;
background-color: #eee;
color: #666;
font-size: 0.7em;
padding: 2px;
text-align: center;
}
#loading {
margin-left: 170px;
background-color: #eee;
color: #333;
font-size: 0.7em;
padding: 2px;
text-align: center;
}
#side2 {
position: fixed !important;
position: absolute; /* IE6 reads this */
height: 600px;
width: 160px;
bottom: 10px;
left: 5px;
padding-top: 0px;
z-index: 1;
}

286
src/main/webapp/pstat.jsp Normal file
View File

@ -0,0 +1,286 @@
<%@ page info="index" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="false" %>
<%
String contextRoot = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache, must-revalidate" />
<link rel="icon" href="<%=contextRoot %>/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="<%=contextRoot %>/favicon.ico" type="image/x-icon"/>
<!-- SimpleTabs -->
<link rel="stylesheet" media="screen" type="text/css" href="<%=contextRoot %>/simpletabs.css" />
<script type="text/javascript" src="<%=contextRoot %>/simpletabs_1.3.packed.js"></script>
<title>PlantUML logs</title>
</head>
<body>
<%
if (net.sourceforge.plantuml.pstat.Stats.USE_STATS) {
net.sourceforge.plantuml.pstat.tick.GraphData gd = net.sourceforge.plantuml.pstat.Stats.getInstance().getGraphData();
%>
<div class="simpleTabs">
<ul class="simpleTabsNavigation">
<li><a href="#">Last 10 minutes</a></li>
<li><a href="#">Last 60 minutes</a></li>
<li><a href="#">Last 48 hours</a></li>
<li><a href="#">Last 15 days</a></li>
<li><a href="#">Last 24 months</a></li>
</ul>
<div class="simpleTabsContent">
<!-- 10 ------------------------ -->
<h3>Diagrams per minutes</h3>
<% gd.hminutes10().getHistogramBuilder().getHistogram(200, 30, 12).printSvg(out); %>
<table border=0 cellspacing=0 cellpadding=6>
<tr>
<td>
<h3>Image Server Generation</h3>
<% gd.hminutes10().getChartImageGeneration(150).printSvg(out); %>
</td>
<td>
<h3>Diagrams generated</h3>
<% gd.minutes10().getChartType(150).printSvg(out); %>
</td>
</tr>
<tr>
<td>
<h3>Page Load</h3>
<% gd.bminutes10().getChartPageLoad(150).printSvg(out); %>
</td>
<td>
<h3>Image Load</h3>
<% gd.bminutes10().getChartImageLoad(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Browser</h3>
<% gd.minutes10().getChartBrowser(150).printSvg(out); %>
</td>
<td valign=top>
<h3>Operation System</h3>
<% gd.minutes10().getChartOperationSystem(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Site using image generation</h3>
<% gd.minutes10().getChartIncomming(150).printSvg(out); %>
</td>
</tr>
</table>
<h3>Country & Language</h3>
<table border=0 cellspacing=0 cellpadding=6 valign=top>
<tr valign=top>
<td valign=top>
<% gd.minutes10().getHistoListCountry(400, 20, 12).printSvg(out); %>
</td>
<td valign=top>
<% gd.minutes10().getChartLanguage(150).printSvg(out); %>
</td>
</tr>
</table>
<!-- 10 ------------------------ -->
</div>
<div class="simpleTabsContent">
<!-- 60 ------------------------ -->
<h3>Diagrams per minutes</h3>
<% gd.hminutes60().getHistogramBuilder().getHistogram(200, 18, 12).printSvg(out); %>
<table border=0 cellspacing=0 cellpadding=6>
<tr>
<td>
<h3>Image Server Generation</h3>
<% gd.hminutes60().getChartImageGeneration(150).printSvg(out); %>
</td>
<td>
<h3>Diagrams generated</h3>
<% gd.minutes60().getChartType(150).printSvg(out); %>
</td>
</tr>
<tr>
<td>
<h3>Page Load</h3>
<% gd.bminutes60().getChartPageLoad(150).printSvg(out); %>
</td>
<td>
<h3>Image Load</h3>
<% gd.bminutes60().getChartImageLoad(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Browser</h3>
<% gd.minutes60().getChartBrowser(150).printSvg(out); %>
</td>
<td valign=top>
<h3>Operation System</h3>
<% gd.minutes60().getChartOperationSystem(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Site using image generation</h3>
<% gd.minutes60().getChartIncomming(150).printSvg(out); %>
</td>
</tr>
</table>
<h3>Country & Language</h3>
<table border=0 cellspacing=0 cellpadding=6 valign=top>
<tr valign=top>
<td valign=top>
<% gd.minutes60().getHistoListCountry(400, 20, 12).printSvg(out); %>
</td>
<td valign=top>
<% gd.minutes60().getChartLanguage(150).printSvg(out); %>
</td>
</tr>
</table>
<!-- 60 ------------------------ -->
</div>
<div class="simpleTabsContent">
<!-- 48 ------------------------ -->
<h3>Diagrams per hour</h3>
<% gd.hhours48().getHistogramBuilder().getHistogram(200, 22, 12).printSvg(out); %>
<table border=0 cellspacing=0 cellpadding=6>
<tr>
<td>
<h3>Image Server Generation</h3>
<% gd.hhours48().getChartImageGeneration(150).printSvg(out); %>
</td>
<td>
<h3>Diagrams generated</h3>
<% gd.hours48().getChartType(150).printSvg(out); %>
</td>
</tr>
<tr>
<td>
<h3>Page Load</h3>
<% gd.bhours48().getChartPageLoad(150).printSvg(out); %>
</td>
<td>
<h3>Image Load</h3>
<% gd.bhours48().getChartImageLoad(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Browser</h3>
<% gd.hours48().getChartBrowser(150).printSvg(out); %>
</td>
<td valign=top>
<h3>Operation System</h3>
<% gd.hours48().getChartOperationSystem(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Site using image generation</h3>
<% gd.hours48().getChartIncomming(150).printSvg(out); %>
</td>
</tr>
</table>
<h3>Country & Language</h3>
<table border=0 cellspacing=0 cellpadding=6 valign=top>
<tr valign=top>
<td valign=top>
<% gd.hours48().getHistoListCountry(400, 20, 12).printSvg(out); %>
</td>
<td valign=top>
<% gd.hours48().getChartLanguage(150).printSvg(out); %>
</td>
</tr>
</table>
<!-- 48 ------------------------ -->
</div>
<div class="simpleTabsContent">
<!-- 15 ------------------------ -->
<h3>Diagrams per day</h3>
<% gd.hdays15().getHistogramBuilder().getHistogram(200, 50, 12).printSvg(out); %>
<table border=0 cellspacing=0 cellpadding=6>
<tr>
<td>
<h3>Image Server Generation</h3>
<% gd.hdays15().getChartImageGeneration(150).printSvg(out); %>
</td>
<td>
<h3>Diagrams generated</h3>
<% gd.days15().getChartType(150).printSvg(out); %>
</td>
</tr>
<tr>
<td>
<h3>Page Load</h3>
<% gd.bdays15().getChartPageLoad(150).printSvg(out); %>
</td>
<td>
<h3>Image Load</h3>
<% gd.bdays15().getChartImageLoad(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Browser</h3>
<% gd.days15().getChartBrowser(150).printSvg(out); %>
</td>
<td valign=top>
<h3>Operation System</h3>
<% gd.days15().getChartOperationSystem(150).printSvg(out); %>
</td>
</tr>
<tr valign=top>
<td valign=top>
<h3>Site using image generation</h3>
<% gd.days15().getChartIncomming(150).printSvg(out); %>
</td>
</tr>
</table>
<h3>Country & Language</h3>
<table border=0 cellspacing=0 cellpadding=6 valign=top>
<tr valign=top>
<td valign=top>
<% gd.days15().getHistoListCountry(400, 20, 12).printSvg(out); %>
</td>
<td valign=top>
<% gd.days15().getChartLanguage(150).printSvg(out); %>
</td>
</tr>
</table>
<!-- 15 ------------------------ -->
</div>
<div class="simpleTabsContent">
<!-- 31 ------------------------ -->
<h3>Diagrams per month</h3>
<%
net.sourceforge.plantuml.pstat.tick.GraphDataLongTerm gdl = net.sourceforge.plantuml.pstat.Stats.getInstance().getGraphDataLongTerm();
gdl.getHistogramBuilder().getHistogram(400, 40, 12).printSvg(out);
%>
<!-- 31 ------------------------ -->
</div>
</div>
<%
}
%>
</body>
</html>

View File

@ -0,0 +1,16 @@
/**
* @version 1.3
* @package SimpleTabs
* @author Fotis Evangelou - http://nuevvo.com/labs/simpletabs
* @copyright Copyright (c) 2009-2011 Fotis Evangelou / Nuevvo Webware Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
div.simpleTabs { padding:10px; }
ul.simpleTabsNavigation { margin:0 10px; padding:0; text-align:left; }
ul.simpleTabsNavigation li { list-style:none; display:inline; margin:0; padding:0; }
ul.simpleTabsNavigation li a { border:1px solid #E0E0E0; padding:3px 6px; background:#F0F0F0; font-size:14px; text-decoration:none; font-family:Georgia, "Times New Roman", Times, serif; }
ul.simpleTabsNavigation li a:hover { background-color:#F6F6F6; }
ul.simpleTabsNavigation li a.current { background:#fff; color:#222; border-bottom:1px solid #fff; }
div.simpleTabsContent { border:1px solid #E0E0E0; padding:5px 15px 15px; margin-top:3px; display:none; }
div.simpleTabsContent.currentTab { display:block; }

View File

@ -0,0 +1,9 @@
/**
* @version 1.3
* @package SimpleTabs
* @author Fotis Evangelou - http://nuevvo.com/labs/simpletabs
* @copyright Copyright (c) 2009-2011 Fotis Evangelou / Nuevvo Webware Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3 4={O:"Z",P:"10",9:"11",w:"12",x:"13",r:"14",Q:o(){5(!s.t)y E;5(!s.F)y E;3 b=s.t("G");u(3 i=0;i<b.7;i++){5(b[i].6==4.O){b[i].H("8",4.r+[i]);3 c=b[i].v("8");3 d=b[i].t("15");u(3 j=0;j<d.7;j++){5(d[j].6==4.P){3 a=d[j].t("a");u(3 k=0;k<a.7;k++){a[k].H("8",c+"I"+k);5(4.z(\'A\')){3 e=4.z(\'A\').J("K");3 f=e[1];3 g=e[2];5(a[k].p.p.p.v("8")==4.r+f){5(a[k].v("8")==4.r+f+"I"+g){a[k].6=4.w}q{a[k].6=""}}q{a[0].6=4.w}}q{a[0].6=4.w}a[k].16=o(){4.R(B,\'A\');y E}}}}3 h=b[i].t("G");3 m=0;u(3 l=0;l<h.7;l++){5(h[l].6==4.9){h[l].H("8",c+"L"+[m]);5(4.z(\'A\')){3 e=4.z(\'A\').J("K");3 f=e[1];3 g=e[2];5(h[l].p.v("8")==4.r+f){5(h[l].v("8")==4.r+f+"L"+g){h[l].6=4.9+" "+4.x}q{h[l].6=4.9}}q{h[0].6=4.9+" "+4.x}}q{h[0].6=4.9+" "+4.x}m++}}}}},R:o(a,b){B.S(b);3 c=a.p.p.p.v("8");3 d=c+"I";3 e=a.v("8").T(d,"");3 f=a.p.p.t("a");u(3 n=0;n<f.7;n++){f[n].6=""}a.6=4.w;3 g=s.F(c).t("G");3 h=M U(4.9);u(3 i=0;i<g.7;i++){5(h.17(g[i].6)){g[i].6=4.9}}s.F(c+"L"+e).6=4.9+" "+4.x;3 j=M U(4.r);3 k=c.T(j,"");B.N(b,\'18\'+k+\'K\'+e,1)},N:o(a,b,c){5(c){3 d=M 19();d.1a(d.1b()+(c*1c*V*V*1d));3 e="; 1e="+d.1f()}q 3 e="";s.W=a+"="+b+e+"; 1g=/"},z:o(a){3 b=a+"=";3 d=s.W.J(\';\');u(3 i=0;i<d.7;i++){3 c=d[i];1h(c.1i(0)==\' \')c=c.X(1,c.7);5(c.1j(b)==0)y c.X(b.7,c.7)}y 1k},S:o(a){B.N(a,"",-1)},Y:o(a){3 b=C.D;5(1l C.D!=\'o\'){C.D=a}q{C.D=o(){5(b){b()}a()}}}};4.Y(4.Q);',62,84,'|||var|kmrSimpleTabs|if|className|length|id|sbContentClass|||||||||||||||function|parentNode|else|sbIdPrefix|document|getElementsByTagName|for|getAttribute|sbCurrentNavClass|sbCurrentTabClass|return|readCookie|simpleTabsCookie|this|window|onload|false|getElementById|div|setAttribute|_a_|split|_|_div_|new|createCookie|sbContainerClass|sbNavClass|init|setCurrent|eraseCookie|replace|RegExp|60|cookie|substring|addLoadEvent|simpleTabs|simpleTabsNavigation|simpleTabsContent|current|currentTab|tabber|ul|onclick|test|simpleTabsCookie_|Date|setTime|getTime|24|1000|expires|toGMTString|path|while|charAt|indexOf|null|typeof'.split('|'),0,{}))