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

Skip to content
Snippets Groups Projects
Verified Commit d51a7ccf authored by zzz's avatar zzz
Browse files

Router: Consolidate watchdog logging

parent 5502eda4
No related branches found
No related tags found
No related merge requests found
......@@ -76,37 +76,28 @@ public class RouterWatchdog implements Runnable {
private void dumpStatus() {
if (_log.shouldLog(Log.ERROR)) {
/*
Job cur = _context.jobQueue().getLastJob();
if (cur != null)
_log.error("Most recent job: " + cur);
_log.error("Last job began: "
+ DataHelper.formatDuration(_context.clock().now()-_context.jobQueue().getLastJobBegin())
+ " ago");
_log.error("Last job ended: "
+ DataHelper.formatDuration(_context.clock().now()-_context.jobQueue().getLastJobEnd())
+ " ago");
*/
_log.error("Ready and waiting jobs: " + _context.jobQueue().getReadyCount());
_log.error("Job lag: " + _context.jobQueue().getMaxLag());
_log.error("Participating tunnel count: " + _context.tunnelManager().getParticipatingCount());
RateStat rs = _context.statManager().getRate("transport.sendProcessingTime");
Rate r = null;
if (rs != null)
r = rs.getRate(60*1000);
double processTime = (r != null ? r.getAverageValue() : 0);
_log.error("1 minute send processing time: " + DataHelper.formatDuration((long)processTime));
rs = _context.statManager().getRate("bw.sendBps");
r = null;
if (rs != null)
r = rs.getRate(60*1000);
double bps = (r != null ? r.getAverageValue() : 0);
_log.error("Outbound send rate: " + DataHelper.formatSize((long)bps) + "Bps");
long max = Runtime.getRuntime().maxMemory();
long used = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
_log.error("Memory: " + DataHelper.formatSize(used) + "B / " + DataHelper.formatSize(max) + 'B');
_log.error("Watchdog status\nComm system: " + _context.commSystem().getStatus() +
"\nPeers: " + _context.commSystem().countActivePeers() +
"\nReady and waiting jobs: " + _context.jobQueue().getReadyCount() +
"\nLag: " + DataHelper.formatDuration(_context.jobQueue().getMaxLag()) +
"\nPart. tunnels: " + _context.tunnelManager().getParticipatingCount() +
"\nSend processing time: " + DataHelper.formatDuration((long)processTime) +
"\nSend rate: " + DataHelper.formatSize((long)bps) + "Bps" +
"\nMemory: " + DataHelper.formatSize(used) + "B / " + DataHelper.formatSize(max) + 'B');
if (_consecutiveErrors == 1) {
_log.log(Log.CRIT, "Router appears hung, or there is severe network congestion. Watchdog starts barking!");
_context.router().eventLog().addEvent(EventLog.WATCHDOG);
......
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