forked from I2P_Developers/i2p.i2p
Router: Consolidate watchdog logging
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user