2007-07-15 zzz

* Add current values to graph legends
    * Fix up previous Rate fix to check for divide by zero
This commit is contained in:
zzz
2007-07-15 18:34:33 +00:00
committed by zzz
parent 4acd2996c5
commit 5c1dc79767
5 changed files with 23 additions and 11 deletions

View File

@ -151,7 +151,7 @@ public class StatSummarizer implements Runnable {
//long begin = System.currentTimeMillis(); //long begin = System.currentTimeMillis();
try { try {
RrdGraphDef def = new RrdGraphDef(); RrdGraphDef def = new RrdGraphDef();
def.setTimePeriod(start/1000, end/1000); def.setTimePeriod(start/1000, 0);
def.setBaseValue(1024); def.setBaseValue(1024);
String title = "Bandwidth usage"; String title = "Bandwidth usage";
if (!hideTitle) if (!hideTitle)

View File

@ -182,12 +182,16 @@ class SummaryRenderer {
//long begin = System.currentTimeMillis(); //long begin = System.currentTimeMillis();
try { try {
RrdGraphDef def = new RrdGraphDef(); RrdGraphDef def = new RrdGraphDef();
def.setTimePeriod(start/1000, end/1000); def.setTimePeriod(start/1000, 0);
String name = _listener.getRate().getRateStat().getName(); String name = _listener.getRate().getRateStat().getName();
if ((name.startsWith("bw.") || name.endsWith("PacketSize")) && !showEvents) if ((name.startsWith("bw.") || name.endsWith("PacketSize")) && !showEvents)
def.setBaseValue(1024); def.setBaseValue(1024);
String title = name + " averaged for " String title = name;
+ DataHelper.formatDuration(_listener.getRate().getPeriod()); if (showEvents)
title = title + " events in ";
else
title = title + " averaged for ";
title = title + DataHelper.formatDuration(_listener.getRate().getPeriod());
if (!hideTitle) if (!hideTitle)
def.setTitle(title); def.setTitle(title);
String path = _listener.getData().getPath(); String path = _listener.getData().getPath();
@ -206,8 +210,9 @@ class SummaryRenderer {
def.datasource(plotName, path, plotName, "AVERAGE", "MEMORY"); def.datasource(plotName, path, plotName, "AVERAGE", "MEMORY");
def.area(plotName, Color.BLUE, descr + "@r"); def.area(plotName, Color.BLUE, descr + "@r");
if (!hideLegend) { if (!hideLegend) {
def.gprint(plotName, "AVERAGE", "average: @2@s"); def.gprint(plotName, "AVERAGE", "avg: @2@s");
def.gprint(plotName, "MAX", " max: @2@s@r"); def.gprint(plotName, "MAX", " max: @2@s");
def.gprint(plotName, "LAST", " now: @2@s@r");
} }
if (!showCredit) if (!showCredit)
def.setShowSignature(false); def.setShowSignature(false);

View File

@ -202,6 +202,9 @@ public class Rate {
_lastEventCount = (long) (0.499999 + (_currentEventCount / periodFactor)); _lastEventCount = (long) (0.499999 + (_currentEventCount / periodFactor));
_lastTotalEventTime = (long) (_currentTotalEventTime / periodFactor); _lastTotalEventTime = (long) (_currentTotalEventTime / periodFactor);
_lastCoalesceDate = now; _lastCoalesceDate = now;
if (_currentEventCount == 0)
correctedTotalValue = 0;
else
correctedTotalValue = _currentTotalValue * correctedTotalValue = _currentTotalValue *
(_lastEventCount / (double) _currentEventCount); (_lastEventCount / (double) _currentEventCount);

View File

@ -1,4 +1,8 @@
$Id: history.txt,v 1.575 2007-07-14 13:44:11 zzz Exp $ $Id: history.txt,v 1.576 2007-07-14 19:56:18 complication Exp $
2007-07-15 zzz
* Add current values to graph legends
* Fix up previous Rate fix to check for divide by zero
2007-07-14 Complication 2007-07-14 Complication
* Take the post-download routerInfo size check back out of ReseedHandler, * Take the post-download routerInfo size check back out of ReseedHandler,

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
* *
*/ */
public class RouterVersion { public class RouterVersion {
public final static String ID = "$Revision: 1.510 $ $Date: 2007-07-14 13:44:12 $"; public final static String ID = "$Revision: 1.511 $ $Date: 2007-07-14 19:56:20 $";
public final static String VERSION = "0.6.1.28"; public final static String VERSION = "0.6.1.28";
public final static long BUILD = 13; public final static long BUILD = 14;
public static void main(String args[]) { public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION + "-" + BUILD); System.out.println("I2P Router version: " + VERSION + "-" + BUILD);
System.out.println("Router ID: " + RouterVersion.ID); System.out.println("Router ID: " + RouterVersion.ID);