diff --git a/apps/i2psnark/java/src/org/klomp/snark/dht/KRPC.java b/apps/i2psnark/java/src/org/klomp/snark/dht/KRPC.java
index 1d253c049..a65cbc05a 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/dht/KRPC.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/dht/KRPC.java
@@ -684,10 +684,10 @@ public class KRPC implements I2PSessionMuxedListener, DHT {
StringBuilder buf = new StringBuilder(256);
buf.append("
DHT DEBUG
TX: ").append(_txPkts.get()).append(" pkts / ")
.append(DataHelper.formatSize2(_txBytes.get())).append("B / ")
- .append(DataHelper.formatSize2(_txBytes.get() * 1000 / uptime)).append("Bps
" +
+ .append(DataHelper.formatSize2Decimal(_txBytes.get() * 1000 / uptime)).append("Bps
" +
"RX: ").append(_rxPkts.get()).append(" pkts / ")
.append(DataHelper.formatSize2(_rxBytes.get())).append("B / ")
- .append(DataHelper.formatSize2(_rxBytes.get() * 1000 / uptime)).append("Bps
" +
+ .append(DataHelper.formatSize2Decimal(_rxBytes.get() * 1000 / uptime)).append("Bps
" +
"DHT Peers: ").append( _knownNodes.size()).append("
" +
"Blacklisted: ").append(_blacklist.size()).append("
" +
"Sent tokens: ").append(_outgoingTokens.size()).append("
" +
diff --git a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
index 45870da91..258dc7065 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
@@ -1754,7 +1754,7 @@ public class I2PSnarkServlet extends BasicServlet {
out.write("");
out.write("
");
out.write("
");
out.write(formatSize(total-remaining) + thinsp(noThinsp) + formatSize(total));
out.write("
");
@@ -2752,18 +2752,8 @@ public class I2PSnarkServlet extends BasicServlet {
return null;
}
- // rounding makes us look faster :)
private static String formatSize(long bytes) {
- if (bytes < 5000)
-
- // replace with narrow non-breaking space ( )
- return bytes + " B";
- else if (bytes < 5*1024*1024)
- return ((bytes + 512)/1024) + " KB";
- else if (bytes < 10*1024*1024*1024l)
- return ((bytes + 512*1024)/(1024*1024)) + " MB";
- else
- return ((bytes + 512*1024*1024)/(1024*1024*1024)) + " GB";
+ return DataHelper.formatSize2(bytes) + 'B';
}
/**
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java
index 03f7e5435..8571ef6ad 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java
@@ -171,7 +171,8 @@ class SummaryRenderer {
def.setMinValue(0d);
String name = _listener.getRate().getRateStat().getName();
// heuristic to set K=1024
- if ((name.startsWith("bw.") || name.indexOf("Size") >= 0 || name.indexOf("Bps") >= 0 || name.indexOf("memory") >= 0)
+ //if ((name.startsWith("bw.") || name.indexOf("Size") >= 0 || name.indexOf("Bps") >= 0 || name.indexOf("memory") >= 0)
+ if ((name.indexOf("Size") >= 0 || name.indexOf("memory") >= 0)
&& !showEvents)
def.setBase(1024);
if (titleOverride != null) {
@@ -192,8 +193,8 @@ class SummaryRenderer {
}
String path = _listener.getData().getPath();
String dsNames[] = _listener.getData().getDsNames();
- String plotName = null;
- String descr = null;
+ String plotName;
+ String descr;
if (showEvents) {
// include the average event count on the plot
plotName = dsNames[1];
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigLoggingHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigLoggingHelper.java
index 3a78adc4c..e8415fe77 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigLoggingHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigLoggingHelper.java
@@ -24,7 +24,7 @@ public class ConfigLoggingHelper extends HelperBase {
}
public String getMaxFileSize() {
int bytes = _context.logManager().getFileSize();
- if (bytes <= 0) return "1.00 MB";
+ if (bytes <= 0) return "1.00 MiB";
return DataHelper.formatSize2(bytes, false) + 'B';
}
public String getLogLevelTable() {
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigNetHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigNetHandler.java
index be2ed8a0f..ea08fa77b 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigNetHandler.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigNetHandler.java
@@ -502,12 +502,12 @@ public class ConfigNetHandler extends FormHandler {
!_inboundRate.equals(_context.getProperty(FIFOBandwidthRefiller.PROP_INBOUND_BURST_BANDWIDTH,
Integer.toString(FIFOBandwidthRefiller.DEFAULT_INBOUND_BURST_BANDWIDTH)))) {
try {
- int rate = Integer.parseInt(_inboundRate);
- int kb = DEF_BURST_TIME * rate;
- changes.put(FIFOBandwidthRefiller.PROP_INBOUND_BURST_BANDWIDTH, Integer.toString(rate));
- changes.put(FIFOBandwidthRefiller.PROP_INBOUND_BANDWIDTH_PEAK, Integer.toString(kb));
+ float rate = Integer.parseInt(_inboundRate) / 1.024f;
+ float kb = DEF_BURST_TIME * rate;
+ changes.put(FIFOBandwidthRefiller.PROP_INBOUND_BURST_BANDWIDTH, Integer.toString(Math.round(rate)));
+ changes.put(FIFOBandwidthRefiller.PROP_INBOUND_BANDWIDTH_PEAK, Integer.toString(Math.round(kb)));
rate -= Math.min(rate * DEF_BURST_PCT / 100, 50);
- changes.put(FIFOBandwidthRefiller.PROP_INBOUND_BANDWIDTH, Integer.toString(rate));
+ changes.put(FIFOBandwidthRefiller.PROP_INBOUND_BANDWIDTH, Integer.toString(Math.round(rate)));
bwUpdated = true;
} catch (NumberFormatException nfe) {
addFormError(_t("Invalid bandwidth"));
@@ -517,12 +517,12 @@ public class ConfigNetHandler extends FormHandler {
!_outboundRate.equals(_context.getProperty(FIFOBandwidthRefiller.PROP_OUTBOUND_BURST_BANDWIDTH,
Integer.toString(FIFOBandwidthRefiller.DEFAULT_OUTBOUND_BURST_BANDWIDTH)))) {
try {
- int rate = Integer.parseInt(_outboundRate);
- int kb = DEF_BURST_TIME * rate;
- changes.put(FIFOBandwidthRefiller.PROP_OUTBOUND_BURST_BANDWIDTH, Integer.toString(rate));
- changes.put(FIFOBandwidthRefiller.PROP_OUTBOUND_BANDWIDTH_PEAK, Integer.toString(kb));
+ float rate = Integer.parseInt(_outboundRate) / 1.024f;
+ float kb = DEF_BURST_TIME * rate;
+ changes.put(FIFOBandwidthRefiller.PROP_OUTBOUND_BURST_BANDWIDTH, Integer.toString(Math.round(rate)));
+ changes.put(FIFOBandwidthRefiller.PROP_OUTBOUND_BANDWIDTH_PEAK, Integer.toString(Math.round(kb)));
rate -= Math.min(rate * DEF_BURST_PCT / 100, 50);
- changes.put(FIFOBandwidthRefiller.PROP_OUTBOUND_BANDWIDTH, Integer.toString(rate));
+ changes.put(FIFOBandwidthRefiller.PROP_OUTBOUND_BANDWIDTH, Integer.toString(Math.round(rate)));
bwUpdated = true;
} catch (NumberFormatException nfe) {
addFormError(_t("Invalid bandwidth"));
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigNetHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigNetHelper.java
index bd1c923b8..e85652ec7 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigNetHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/ConfigNetHelper.java
@@ -243,36 +243,46 @@ public class ConfigNetHelper extends HelperBase {
return buf.toString();
}
+ /** @return decimal */
public String getInboundRate() {
- return Integer.toString(_context.bandwidthLimiter().getInboundKBytesPerSecond());
+ return Integer.toString(Math.round(_context.bandwidthLimiter().getInboundKBytesPerSecond() * 1.024f));
}
+ /** @return decimal */
public String getOutboundRate() {
- return Integer.toString(_context.bandwidthLimiter().getOutboundKBytesPerSecond());
+ return Integer.toString(Math.round(_context.bandwidthLimiter().getOutboundKBytesPerSecond() * 1.024f));
}
+ /** @return decimal */
public String getInboundBurstRateBits() {
return kbytesToBits(_context.bandwidthLimiter().getInboundBurstKBytesPerSecond());
}
+ /** @return decimal */
public String getOutboundBurstRateBits() {
return kbytesToBits(_context.bandwidthLimiter().getOutboundBurstKBytesPerSecond());
}
+ /** @return decimal */
public String getShareRateBits() {
return kbytesToBits(getShareBandwidth());
}
- private String kbytesToBits(int kbytes) {
- return DataHelper.formatSize(kbytes * (8 * 1024L)) + ' ' + _t("bits per second") +
- ' ' + _t("or {0} bytes per month maximum", DataHelper.formatSize(kbytes * (1024L * 60 * 60 * 24 * 31)));
+
+ /** @param kbytes binary K */
+ private String kbytesToBits(float kbytes) {
+ return DataHelper.formatSize2Decimal((long) (kbytes * (8 * 1024))) + _t("bits per second") +
+ "; " +
+ _t("{0}Bytes per month maximum", DataHelper.formatSize2Decimal((long) (kbytes * (1024L * 60 * 60 * 24 * 31))));
}
+ /** @return decimal */
public String getInboundBurstRate() {
- return Integer.toString(_context.bandwidthLimiter().getInboundBurstKBytesPerSecond());
+ return Integer.toString(Math.round(_context.bandwidthLimiter().getInboundBurstKBytesPerSecond() * 1.024f));
}
+ /** @return decimal */
public String getOutboundBurstRate() {
- return Integer.toString(_context.bandwidthLimiter().getOutboundBurstKBytesPerSecond());
+ return Integer.toString(Math.round(_context.bandwidthLimiter().getOutboundBurstKBytesPerSecond() * 1.024f));
}
/*
@@ -350,7 +360,7 @@ public class ConfigNetHelper extends HelperBase {
public static final int DEFAULT_SHARE_KBPS = 12;
/**
- * @return in KBytes per second
+ * @return in binary KBytes per second
*/
public int getShareBandwidth() {
int irateKBps = _context.bandwidthLimiter().getInboundKBytesPerSecond();
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/PeerHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/PeerHelper.java
index d447757ce..b8b509ec3 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/PeerHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/PeerHelper.java
@@ -224,7 +224,7 @@ public class PeerHelper extends HelperBase {
buf.append("");
if (con.getTimeSinceReceive() < 2*60*1000) {
float r = con.getRecvRate();
- buf.append(formatRate(r / 1024));
+ buf.append(formatRate(r / 1000));
bpsRecv += r;
} else {
buf.append(formatRate(0));
@@ -232,7 +232,7 @@ public class PeerHelper extends HelperBase {
buf.append("").append(THINSP).append("");
if (con.getTimeSinceSend() < 2*60*1000) {
float r = con.getSendRate();
- buf.append(formatRate(r / 1024));
+ buf.append(formatRate(r / 1000));
bpsSend += r;
} else {
buf.append(formatRate(0));
@@ -268,8 +268,8 @@ public class PeerHelper extends HelperBase {
// buf.append("
| \n");
buf.append("");
buf.append("| | ")
- .append("X | ").append(_t("Over {0} shared bandwidth", Router.MIN_BW_X + " KBps")).append(" | ")
+ .append("X | ").append(_t("Over {0} shared bandwidth", Math.round(Router.MIN_BW_X * 1.024f) + " KBps")).append(" | ")
.append(" | | | ");
buf.append("| | ").append(_t("Note: For P and X bandwidth tiers, O is included for the purpose of backward compatibility in the NetDB."))
.append(" | ");
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryHelper.java
index 6c52d586d..e1f8150e9 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryHelper.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/SummaryHelper.java
@@ -320,7 +320,7 @@ public class SummaryHelper extends HelperBase {
// long free = Runtime.getRuntime().freeMemory()/1024/1024;
// return integerFormatter.format(used) + "MB (" + usedPc + "%)";
// return integerFormatter.format(used) + "MB / " + free + " MB";
- return integerFormatter.format(used) + " / " + total + " MB";
+ return integerFormatter.format(used) + " / " + total + " MiB";
}
/** @since 0.9.32 */
@@ -349,7 +349,7 @@ public class SummaryHelper extends HelperBase {
// return integerFormatter.format(used) + "MB (" + usedPc + "%)";
// return integerFormatter.format(used) + "MB / " + free + " MB";
return "RAM: " +
- integerFormatter.format(used) + " / " + total + " MB" +
+ integerFormatter.format(used) + " / " + total + " MiB" +
" ";
}
@@ -498,17 +498,18 @@ public class SummaryHelper extends HelperBase {
}
/**
- * @return "x.xx / y.yy {K|M}"
+ * Output is decimal, not binary
+ * @return "x.xx / y.yy {K|M}"
*/
private static String formatPair(double in, double out) {
- boolean mega = in >= 1024*1024 || out >= 1024*1024;
+ boolean mega = in >= 1000*1000 || out >= 1000*1000;
// scale both the same
if (mega) {
- in /= 1024*1024;
- out /= 1024*1024;
+ in /= 1000*1000;
+ out /= 1000*1000;
} else {
- in /= 1024;
- out /= 1024;
+ in /= 1000;
+ out /= 1000;
}
// control total width
DecimalFormat fmt;
@@ -530,9 +531,7 @@ public class SummaryHelper extends HelperBase {
public String getInboundTransferred() {
if (_context == null)
return "0";
-
long received = _context.bandwidthLimiter().getTotalAllocatedInboundBytes();
-
return DataHelper.formatSize2(received) + 'B';
}
@@ -544,7 +543,6 @@ public class SummaryHelper extends HelperBase {
public String getOutboundTransferred() {
if (_context == null)
return "0";
-
long sent = _context.bandwidthLimiter().getTotalAllocatedOutboundBytes();
return DataHelper.formatSize2(sent) + 'B';
}
@@ -957,7 +955,7 @@ public class SummaryHelper extends HelperBase {
String status = checker.getStatus();
if (status.length() > 0) {
// Show status message even if not running, timer in ReseedChecker should remove after 20 minutes
- buf.append("").append(checker.getStatus()).append(" ");
+ buf.append("").append(status).append(" ");
}
if (!checker.inProgress()) {
// If a new reseed isn't running, and the last reseed had errors, show error message
diff --git a/apps/routerconsole/java/src/net/i2p/router/web/helpers/TunnelRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/helpers/TunnelRenderer.java
index d43373d41..0d8bb9081 100644
--- a/apps/routerconsole/java/src/net/i2p/router/web/helpers/TunnelRenderer.java
+++ b/apps/routerconsole/java/src/net/i2p/router/web/helpers/TunnelRenderer.java
@@ -185,7 +185,7 @@ class TunnelRenderer {
+ " | | ");
out.write("| | "
+ "P | " + _t("{0} shared bandwidth", range(Router.MIN_BW_P, Router.MIN_BW_X)) + " | "
- + "X | " + _t("Over {0} shared bandwidth", Router.MIN_BW_X + " KBps") + " | "
+ + "X | " + _t("Over {0} shared bandwidth", Math.round(Router.MIN_BW_X * 1.024f) + " KBps") + " | "
+ " |
");
out.write("");
@@ -193,7 +193,7 @@ class TunnelRenderer {
/** @since 0.9.33 */
static String range(int f, int t) {
- return f + " - " + t + " KBps";
+ return Math.round(f * 1.024f) + " - " + (Math.round(t * 1.024f) - 1) + " KBps";
}
private static class TunnelComparator implements Comparator, Serializable {
@@ -248,7 +248,7 @@ class TunnelRenderer {
_t("Outbound") + "\">");
out.write("" + DataHelper.formatDuration2(timeLeft) + " | \n");
int count = info.getProcessedMessagesCount();
- out.write("" + count + " KB | \n");
+ out.write("" + count + " KiB | \n");
for (int j = 0; j < info.getLength(); j++) {
Hash peer = info.getPeer(j);
TunnelId id = (info.isInbound() ? info.getReceiveTunnelId(j) : info.getSendTunnelId(j));
diff --git a/apps/routerconsole/jsp/config.jsp b/apps/routerconsole/jsp/config.jsp
index 4e0149e0c..7b478d7dd 100644
--- a/apps/routerconsole/jsp/config.jsp
+++ b/apps/routerconsole/jsp/config.jsp
@@ -60,7 +60,7 @@
()
|
|
-<% int share = nethelper.getShareBandwidth();
+<% int share = Math.round(nethelper.getShareBandwidth() * 1.024f);
if (share < 12) {
out.print("");
out.print(intl._t("NOTE"));
diff --git a/core/java/src/net/i2p/data/DataHelper.java b/core/java/src/net/i2p/data/DataHelper.java
index d2dadfd09..128368c6e 100644
--- a/core/java/src/net/i2p/data/DataHelper.java
+++ b/core/java/src/net/i2p/data/DataHelper.java
@@ -1525,8 +1525,15 @@ public class DataHelper {
}
/**
- * Caller should append 'B' or 'b' as appropriate
+ * This is binary, i.e. multiples of 1024.
+ * For decimal, see formatSize2Decimal().
+ *
+ * Caller should append 'B' or 'b' as appropriate.
+ *
+ * No space between the number and the letter.
* NOTE: formatSize2() recommended in most cases for readability
+ *
+ * @return e.g. "123.05Ki"
*/
public static String formatSize(long bytes) {
float val = bytes;
@@ -1540,23 +1547,29 @@ public class DataHelper {
String str = fmt.format(val);
switch (scale) {
- case 1: return str + "K";
- case 2: return str + "M";
- case 3: return str + "G";
- case 4: return str + "T";
- case 5: return str + "P";
- case 6: return str + "E";
- case 7: return str + "Z";
- case 8: return str + "Y";
+ case 1: return str + "Ki";
+ case 2: return str + "Mi";
+ case 3: return str + "Gi";
+ case 4: return str + "Ti";
+ case 5: return str + "Pi";
+ case 6: return str + "Ei";
+ case 7: return str + "Zi";
+ case 8: return str + "Yi";
default: return bytes + "";
}
}
/**
+ * This is binary, i.e. multiples of 1024.
+ * For decimal, see formatSize2Decimal().
+ *
+ * Caller should append 'B' or 'b' as appropriate.
* Like formatSize but with a non-breaking space after the number
* This seems consistent with most style guides out there.
* Use only in HTML, and not inside form values (use
* formatSize2(bytes, false) there instead).
+ *
+ * @return e.g. "123.05 Ki"
* @since 0.7.14, uses thin non-breaking space since 0.9.31
*/
public static String formatSize2(long bytes) {
@@ -1564,9 +1577,15 @@ public class DataHelper {
}
/**
+ * This is binary, i.e. multiples of 1024.
+ * For decimal, see formatSize2Decimal().
+ *
+ * Caller should append 'B' or 'b' as appropriate,
* Like formatSize but with a space after the number
* This seems consistent with most style guides out there.
+ *
* @param nonBreaking use an HTML thin non-breaking space ( )
+ * @return e.g. "123.05 Ki" or "123.05 Ki"
* @since 0.9.31
*/
public static String formatSize2(long bytes, boolean nonBreaking) {
@@ -1581,6 +1600,56 @@ public class DataHelper {
// Replace with thin non-breaking space (more consistent/predictable width between fonts & point sizes)
+ String space = nonBreaking ? " " : " ";
+ String str = fmt.format(val) + space;
+ switch (scale) {
+ case 1: return str + "Ki";
+ case 2: return str + "Mi";
+ case 3: return str + "Gi";
+ case 4: return str + "Ti";
+ case 5: return str + "Pi";
+ case 6: return str + "Ei";
+ case 7: return str + "Zi";
+ case 8: return str + "Yi";
+ default: return bytes + space;
+ }
+ }
+
+ /**
+ * This is decimal, i.e. multiples of 1000.
+ * For binary, see formatSize2().
+ *
+ * Caller should append 'B' or 'b' as appropriate.
+ * Like formatSize but with a space after the number
+ * This seems consistent with most style guides out there.
+ *
+ * @return e.g. "123.05 K"
+ * @since 0.9.34
+ */
+ public static String formatSize2Decimal(long bytes) {
+ return formatSize2Decimal(bytes, true);
+ }
+
+ /**
+ * This is decimal, i.e. multiples of 1000.
+ * For binary, see formatSize2().
+ *
+ * Caller should append 'B' or 'b' as appropriate.
+ * Like formatSize but with a space after the number
+ * This seems consistent with most style guides out there.
+ *
+ * @param nonBreaking use an HTML thin non-breaking space ( )
+ * @return e.g. "123.05 K" or "123.05 K"
+ * @since 0.9.34
+ */
+ public static String formatSize2Decimal(long bytes, boolean nonBreaking) {
+ double val = bytes;
+ int scale = 0;
+ while (val >= 1000) {
+ scale++;
+ val /= 1000;
+ }
+ DecimalFormat fmt = new DecimalFormat("##0.00");
String space = nonBreaking ? " " : " ";
String str = fmt.format(val) + space;
switch (scale) {
diff --git a/core/java/src/net/i2p/util/LogManager.java b/core/java/src/net/i2p/util/LogManager.java
index 09ef6f351..b668580df 100644
--- a/core/java/src/net/i2p/util/LogManager.java
+++ b/core/java/src/net/i2p/util/LogManager.java
@@ -552,7 +552,9 @@ public class LogManager implements Flushable {
String v = size.trim().toUpperCase(Locale.US);
if (v.length() < 2)
return -1;
- if (v.endsWith("B"))
+ if (v.endsWith("IB"))
+ v = v.substring(0, v.length() - 2);
+ else if (v.endsWith("B"))
v = v.substring(0, v.length() - 1);
char mod = v.charAt(v.length() - 1);
if (!Character.isDigit(mod)) v = v.substring(0, v.length() - 1);
diff --git a/router/java/src/net/i2p/router/Router.java b/router/java/src/net/i2p/router/Router.java
index e0ea10cb8..9a8159da8 100644
--- a/router/java/src/net/i2p/router/Router.java
+++ b/router/java/src/net/i2p/router/Router.java
@@ -973,19 +973,26 @@ public class Router implements RouterClock.ClockShiftListener {
@Deprecated
public static final char CAPABILITY_NEW_TUNNEL = 'T';
- /** @since 0.9.33 */
+ /** In binary (1024) Kbytes
+ * @since 0.9.33 */
public static final int MIN_BW_K = 0;
- /** @since 0.9.33 */
+ /** In binary (1024) Kbytes
+ * @since 0.9.33 */
public static final int MIN_BW_L = 12;
- /** @since 0.9.33 */
+ /** In binary (1024) Kbytes
+ * @since 0.9.33 */
public static final int MIN_BW_M = 48;
- /** @since 0.9.33 */
+ /** In binary (1024) Kbytes
+ * @since 0.9.33 */
public static final int MIN_BW_N = 64;
- /** @since 0.9.33 */
+ /** In binary (1024) Kbytes
+ * @since 0.9.33 */
public static final int MIN_BW_O = 128;
- /** @since 0.9.33 */
+ /** In binary (1024) Kbytes
+ * @since 0.9.33 */
public static final int MIN_BW_P = 256;
- /** @since 0.9.33 */
+ /** In binary (1024) Kbytes
+ * @since 0.9.33 */
public static final int MIN_BW_X = 2000;
/**
diff --git a/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java b/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java
index 811625222..c7dfb4031 100644
--- a/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java
+++ b/router/java/src/net/i2p/router/transport/FIFOBandwidthLimiter.java
@@ -133,16 +133,28 @@ public class FIFOBandwidthLimiter {
/** @return smoothed 15 second rate */
public float getReceiveBps15s() { return _recvBps15s; }
- /** The configured maximum, not the current rate */
+ /**
+ * The configured maximum, not the current rate.
+ * In binary K, i.e. rate / 1024.
+ */
public int getOutboundKBytesPerSecond() { return _refiller.getOutboundKBytesPerSecond(); }
- /** The configured maximum, not the current rate */
+ /**
+ * The configured maximum, not the current rate.
+ * In binary K, i.e. rate / 1024.
+ */
public int getInboundKBytesPerSecond() { return _refiller.getInboundKBytesPerSecond(); }
- /** The configured maximum, not the current rate */
+ /**
+ * The configured maximum, not the current rate.
+ * In binary K, i.e. rate / 1024.
+ */
public int getOutboundBurstKBytesPerSecond() { return _refiller.getOutboundBurstKBytesPerSecond(); }
- /** The configured maximum, not the current rate */
+ /**
+ * The configured maximum, not the current rate.
+ * In binary K, i.e. rate / 1024.
+ */
public int getInboundBurstKBytesPerSecond() { return _refiller.getInboundBurstKBytesPerSecond(); }
public synchronized void reinitialize() {
|