2006-02-16 jrandom
* Add a new toggle to the web config to enable/disable the load testing
This commit is contained in:
@ -18,6 +18,7 @@ import java.util.Set;
|
||||
import net.i2p.time.Timestamper;
|
||||
import net.i2p.router.transport.udp.UDPTransport;
|
||||
import net.i2p.router.Router;
|
||||
import net.i2p.router.LoadTestManager;
|
||||
import net.i2p.data.RouterInfo;
|
||||
import net.i2p.router.web.ConfigServiceHandler.UpdateWrapperManagerTask;
|
||||
import net.i2p.router.web.ConfigServiceHandler.UpdateWrapperManagerAndRekeyTask;
|
||||
@ -46,6 +47,7 @@ public class ConfigNetHandler extends FormHandler {
|
||||
private String _outboundBurstRate;
|
||||
private String _outboundBurst;
|
||||
private String _reseedFrom;
|
||||
private boolean _enableLoadTesting;
|
||||
private String _sharePct;
|
||||
private boolean _ratesOnly;
|
||||
|
||||
@ -72,6 +74,7 @@ public class ConfigNetHandler extends FormHandler {
|
||||
public void setHiddenMode(String moo) { _hiddenMode = true; }
|
||||
public void setDynamicKeys(String moo) { _dynamicKeys = true; }
|
||||
public void setUpdateratesonly(String moo) { _ratesOnly = true; }
|
||||
public void setEnableloadtesting(String moo) { _enableLoadTesting = true; }
|
||||
|
||||
public void setHostname(String hostname) {
|
||||
_hostname = (hostname != null ? hostname.trim() : null);
|
||||
@ -313,6 +316,8 @@ public class ConfigNetHandler extends FormHandler {
|
||||
} else {
|
||||
_context.router().setConfigSetting(Timestamper.PROP_DISABLED, "true");
|
||||
}
|
||||
|
||||
LoadTestManager.setEnableLoadTesting(_context, _enableLoadTesting);
|
||||
}
|
||||
|
||||
boolean saved = _context.router().saveConfig();
|
||||
|
@ -4,6 +4,7 @@ import net.i2p.time.Timestamper;
|
||||
import net.i2p.router.RouterContext;
|
||||
import net.i2p.router.CommSystemFacade;
|
||||
import net.i2p.data.RouterAddress;
|
||||
import net.i2p.router.LoadTestManager;
|
||||
import net.i2p.router.transport.udp.UDPAddress;
|
||||
import net.i2p.router.transport.udp.UDPTransport;
|
||||
import net.i2p.router.Router;
|
||||
@ -195,6 +196,13 @@ public class ConfigNetHelper {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
public String getEnableLoadTesting() {
|
||||
if (LoadTestManager.isEnabled(_context))
|
||||
return " checked ";
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getSharePercentageBox() {
|
||||
String pctStr = _context.getProperty(PROP_SHARE_PERCENTAGE);
|
||||
int pct = DEFAULT_SHARE_PERCENTAGE;
|
||||
|
@ -58,6 +58,14 @@
|
||||
<jsp:getProperty name="nethelper" property="sharePercentageBox" /><br />
|
||||
Sharing a higher percentage will improve your anonymity and help the network
|
||||
<hr />
|
||||
<b>Enable load testing: </b>
|
||||
<input type="checkbox" name="enableloadtesting" value="true" <jsp:getProperty name="nethelper" property="enableLoadTesting" /> />
|
||||
<p>If enabled, your router will periodically anonymously probe some of your peers
|
||||
to see what sort of throughput they can handle. This improves your router's ability
|
||||
to pick faster peers, but can cost substantial bandwidth. Relevent data from the
|
||||
load testing is fed into the profiles as well as the
|
||||
<a href="oldstats.jsp#test.rtt">test.rtt</a> and related stats.</p>
|
||||
<hr />
|
||||
<b>Dynamic Router Keys: </b>
|
||||
<input type="checkbox" name="dynamicKeys" value="true" <jsp:getProperty name="nethelper" property="dynamicKeysChecked" /> /><br />
|
||||
<p>
|
||||
|
Reference in New Issue
Block a user