I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 2f28a635 authored by jrandom's avatar jrandom Committed by zzz
Browse files

integrated oOo's memory usage patch (the % shown is unfortunately % of peak,...

integrated oOo's memory usage patch (the % shown is unfortunately % of peak, not % of max) [thanks oOo!]
cleaned up build script to make sure we always build fresh JSPs and xml [thanks oOo^2!]
parent d524c775
No related branches found
No related tags found
No related merge requests found
......@@ -28,10 +28,13 @@
</target>
<target name="war" depends="precompilejsp">
<war destfile="build/routerconsole.war" webxml="../jsp/web-out.xml"
basedir="../jsp/" excludes="web.xml, *.java, *.jsp">
basedir="../jsp/" excludes="web.xml, *.java, *.jsp, web-fragment.xml">
</war>
</target>
<target name="precompilejsp">
<delete dir="../jsp/WEB-INF/" />
<delete dir="../jsp/web-fragment.xml" />
<delete dir="../jsp/web-out.xml" />
<mkdir dir="../jsp/WEB-INF/" />
<mkdir dir="../jsp/WEB-INF/classes" />
<!-- there are various jspc ant tasks, but they all seem a bit flakey -->
......
......@@ -64,6 +64,17 @@ public class SummaryHelper {
else
return DataHelper.formatDuration(router.getUptime());
}
/**
* Retrieve amount of used memory.
*
*/
public String getMemory() {
long used = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())/1024;
long usedPc = 100 - ((Runtime.getRuntime().freeMemory() * 100) / Runtime.getRuntime().totalMemory());
return used + "KB (" + usedPc + "%)";
}
/**
* How many active peers the router has.
......
......@@ -7,6 +7,7 @@
<b>Ident:</b> <jsp:getProperty name="helper" property="ident" /><br />
<b>Version:</b> <jsp:getProperty name="helper" property="version" /><br />
<b>Uptime:</b> <jsp:getProperty name="helper" property="uptime" /><br />
<b>Memory:</b> <jsp:getProperty name="helper" property="memory" /><br />
<hr />
<u><b>Peers</b></u><br />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment