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() {
|
private void dumpStatus() {
|
||||||
if (_log.shouldLog(Log.ERROR)) {
|
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");
|
RateStat rs = _context.statManager().getRate("transport.sendProcessingTime");
|
||||||
Rate r = null;
|
Rate r = null;
|
||||||
if (rs != null)
|
if (rs != null)
|
||||||
r = rs.getRate(60*1000);
|
r = rs.getRate(60*1000);
|
||||||
double processTime = (r != null ? r.getAverageValue() : 0);
|
double processTime = (r != null ? r.getAverageValue() : 0);
|
||||||
_log.error("1 minute send processing time: " + DataHelper.formatDuration((long)processTime));
|
|
||||||
|
|
||||||
rs = _context.statManager().getRate("bw.sendBps");
|
rs = _context.statManager().getRate("bw.sendBps");
|
||||||
r = null;
|
r = null;
|
||||||
if (rs != null)
|
if (rs != null)
|
||||||
r = rs.getRate(60*1000);
|
r = rs.getRate(60*1000);
|
||||||
double bps = (r != null ? r.getAverageValue() : 0);
|
double bps = (r != null ? r.getAverageValue() : 0);
|
||||||
_log.error("Outbound send rate: " + DataHelper.formatSize((long)bps) + "Bps");
|
|
||||||
long max = Runtime.getRuntime().maxMemory();
|
long max = Runtime.getRuntime().maxMemory();
|
||||||
long used = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
|
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) {
|
if (_consecutiveErrors == 1) {
|
||||||
_log.log(Log.CRIT, "Router appears hung, or there is severe network congestion. Watchdog starts barking!");
|
_log.log(Log.CRIT, "Router appears hung, or there is severe network congestion. Watchdog starts barking!");
|
||||||
_context.router().eventLog().addEvent(EventLog.WATCHDOG);
|
_context.router().eventLog().addEvent(EventLog.WATCHDOG);
|
||||||
|
|||||||
Reference in New Issue
Block a user