forked from I2P_Developers/i2p.i2p
* Console, EventLog: Added {BECAME,NOT}_FLOODFILL events. They will now be shown on the console's /events page when the router's ff status changes.
* EventLog: Fix a minor typo.
This commit is contained in:
@ -32,6 +32,7 @@ public class EventLogHelper extends FormHandler {
|
|||||||
private static final String ALL = "all";
|
private static final String ALL = "all";
|
||||||
private static final String[] _events = new String[] {
|
private static final String[] _events = new String[] {
|
||||||
EventLog.ABORTED, _x("Aborted startup"),
|
EventLog.ABORTED, _x("Aborted startup"),
|
||||||
|
EventLog.BECAME_FLOODFILL, _x("Enabled floodfill"),
|
||||||
EventLog.CHANGE_IP, _x("Changed IP"),
|
EventLog.CHANGE_IP, _x("Changed IP"),
|
||||||
EventLog.CHANGE_PORT, _x("Changed port"),
|
EventLog.CHANGE_PORT, _x("Changed port"),
|
||||||
EventLog.CLOCK_SHIFT, _x("Clock shifted"),
|
EventLog.CLOCK_SHIFT, _x("Clock shifted"),
|
||||||
@ -41,6 +42,7 @@ public class EventLogHelper extends FormHandler {
|
|||||||
EventLog.INSTALL_FAILED, _x("Install failed"),
|
EventLog.INSTALL_FAILED, _x("Install failed"),
|
||||||
EventLog.NETWORK, _x("Network error"),
|
EventLog.NETWORK, _x("Network error"),
|
||||||
EventLog.NEW_IDENT, _x("New router identity"),
|
EventLog.NEW_IDENT, _x("New router identity"),
|
||||||
|
EventLog.NOT_FLOODFILL, _x("Disabled floodfill"),
|
||||||
EventLog.OOM, _x("Out of memory error"),
|
EventLog.OOM, _x("Out of memory error"),
|
||||||
EventLog.REKEYED, _x("New router identity"),
|
EventLog.REKEYED, _x("New router identity"),
|
||||||
EventLog.RESEED, _x("Reseeded router"),
|
EventLog.RESEED, _x("Reseeded router"),
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
2014-08-13 zzz
|
2014-08-13 zzz, dg
|
||||||
* Console: Escaping fix (ticket #1346)
|
* Console: Escaping fix (ticket #1346)
|
||||||
* i2psnark: Fix add torrent NPE
|
* i2psnark: Fix add torrent NPE
|
||||||
|
* Console, EventLog: add BECAME_FLOODFILL and NOT_FLOODFILL, they are now shown at the /events page when the router changes its floodfill state
|
||||||
|
|
||||||
2014-08-10 zzz
|
2014-08-10 zzz
|
||||||
Prop from i2p.i2p.zzz.snarkconfig:
|
Prop from i2p.i2p.zzz.snarkconfig:
|
||||||
|
@ -9,6 +9,7 @@ import net.i2p.router.JobImpl;
|
|||||||
import net.i2p.router.Router;
|
import net.i2p.router.Router;
|
||||||
import net.i2p.router.RouterContext;
|
import net.i2p.router.RouterContext;
|
||||||
import net.i2p.router.peermanager.PeerProfile;
|
import net.i2p.router.peermanager.PeerProfile;
|
||||||
|
import net.i2p.router.util.EventLog;
|
||||||
import net.i2p.util.Log;
|
import net.i2p.util.Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,8 +43,14 @@ class FloodfillMonitorJob extends JobImpl {
|
|||||||
boolean wasFF = _facade.floodfillEnabled();
|
boolean wasFF = _facade.floodfillEnabled();
|
||||||
boolean ff = shouldBeFloodfill();
|
boolean ff = shouldBeFloodfill();
|
||||||
_facade.setFloodfillEnabled(ff);
|
_facade.setFloodfillEnabled(ff);
|
||||||
if (ff != wasFF)
|
if (ff != wasFF) {
|
||||||
|
if(ff) {
|
||||||
|
getContext().router().eventLog().addEvent(EventLog.BECAME_FLOODFILL);
|
||||||
|
} else {
|
||||||
|
getContext().router().eventLog().addEvent(EventLog.NOT_FLOODFILL);
|
||||||
|
}
|
||||||
getContext().router().rebuildRouterInfo();
|
getContext().router().rebuildRouterInfo();
|
||||||
|
}
|
||||||
if (_log.shouldLog(Log.INFO))
|
if (_log.shouldLog(Log.INFO))
|
||||||
_log.info("Should we be floodfill? " + ff);
|
_log.info("Should we be floodfill? " + ff);
|
||||||
int delay = (REQUEUE_DELAY / 2) + getContext().random().nextInt(REQUEUE_DELAY);
|
int delay = (REQUEUE_DELAY / 2) + getContext().random().nextInt(REQUEUE_DELAY);
|
||||||
|
@ -32,15 +32,17 @@ public class EventLog {
|
|||||||
|
|
||||||
/** for convenience, not required */
|
/** for convenience, not required */
|
||||||
public static final String ABORTED = "aborted";
|
public static final String ABORTED = "aborted";
|
||||||
|
public static final String BECAME_FLOODFILL = "becameFloodfill";
|
||||||
public static final String CHANGE_IP = "changeIP";
|
public static final String CHANGE_IP = "changeIP";
|
||||||
public static final String CHANGE_PORT = "changePort";
|
public static final String CHANGE_PORT = "changePort";
|
||||||
public static final String CLOCK_SHIFT = "clockShift";
|
public static final String CLOCK_SHIFT = "clockShift";
|
||||||
public static final String CRASHED = "crashed";
|
public static final String CRASHED = "crashed";
|
||||||
public static final String CRITICAL = "critical";
|
public static final String CRITICAL = "critical";
|
||||||
public static final String INSTALLED = "installed";
|
public static final String INSTALLED = "installed";
|
||||||
public static final String INSTALL_FAILED = "intallFailed";
|
public static final String INSTALL_FAILED = "installFailed";
|
||||||
public static final String NETWORK = "network";
|
public static final String NETWORK = "network";
|
||||||
public static final String NEW_IDENT = "newIdent";
|
public static final String NEW_IDENT = "newIdent";
|
||||||
|
public static final String NOT_FLOODFILL = "disabledFloodfill";
|
||||||
public static final String OOM = "oom";
|
public static final String OOM = "oom";
|
||||||
public static final String REKEYED = "rekeyed";
|
public static final String REKEYED = "rekeyed";
|
||||||
public static final String RESEED = "reseed";
|
public static final String RESEED = "reseed";
|
||||||
|
Reference in New Issue
Block a user