forked from I2P_Developers/i2p.i2p
Stats:
- Refactor handling of required stats - Shorten description of required stats - Improve save messages on configstats.jsp - Change bw.sendBps and bw.receiveBps stats to bytes, not Kbytes - Expires directive for graphs
This commit is contained in:
@ -104,14 +104,21 @@ public class ConfigStatsHandler extends FormHandler {
|
||||
}
|
||||
|
||||
_context.router().setConfigSetting(StatManager.PROP_STAT_FILTER, stats.toString());
|
||||
boolean graphsChanged = !_graphs.equals(_context.getProperty("stat.summaries"));
|
||||
_context.router().setConfigSetting("stat.summaries", _graphs);
|
||||
boolean fullChanged = _context.getBooleanProperty(StatManager.PROP_STAT_FULL) != _isFull;
|
||||
_context.router().setConfigSetting(StatManager.PROP_STAT_FULL, "" + _isFull);
|
||||
boolean ok = _context.router().saveConfig();
|
||||
if (ok)
|
||||
_context.router().saveConfig();
|
||||
if (!_stats.isEmpty())
|
||||
addFormNotice(_("Stat filter and location updated successfully to") + ": " + stats.toString());
|
||||
else
|
||||
addFormError(_("Failed to update the stat filter and location"));
|
||||
addFormNotice(_("Graph list updated, may take up to 60s to be reflected here and on the <a href=\"graphs.jsp\">Graphs Page</a>"));
|
||||
if (fullChanged) {
|
||||
if (_isFull)
|
||||
addFormNotice(_("Full statistics enabled - restart required to take effect"));
|
||||
else
|
||||
addFormNotice(_("Full statistics disabled - restart required to take effect"));
|
||||
}
|
||||
if (graphsChanged)
|
||||
addFormNotice(_("Graph list updated, may take up to 60s to be reflected here and on the <a href=\"graphs.jsp\">Graphs Page</a>"));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ public class StatSummarizer implements Runnable {
|
||||
if (txLsnr == null || rxLsnr == null)
|
||||
throw new IOException("no rates for combined graph");
|
||||
|
||||
long end = _context.clock().now() - 60*1000;
|
||||
long end = _context.clock().now() - 75*1000;
|
||||
if (width > GraphHelper.MAX_X)
|
||||
width = GraphHelper.MAX_X;
|
||||
else if (width <= 0)
|
||||
|
@ -83,7 +83,7 @@ class SummaryRenderer {
|
||||
false, false, false, false, -1, false); }
|
||||
|
||||
public void render(OutputStream out, int width, int height, boolean hideLegend, boolean hideGrid, boolean hideTitle, boolean showEvents, int periodCount, boolean showCredit) throws IOException {
|
||||
long end = _listener.now() - 60*1000;
|
||||
long end = _listener.now() - 75*1000;
|
||||
if (periodCount <= 0 || periodCount > _listener.getRows())
|
||||
periodCount = _listener.getRows();
|
||||
long start = end - _listener.getRate().getPeriod()*periodCount;
|
||||
|
Reference in New Issue
Block a user