forked from I2P_Developers/i2p.i2p
* Console: Add a tunnel share ratio estimate
This commit is contained in:
@@ -378,6 +378,12 @@ public class SummaryBarRenderer {
|
||||
.append(_("Participating"))
|
||||
.append(":</b></td><td align=\"right\">")
|
||||
.append(_helper.getParticipatingTunnels())
|
||||
.append("</td></tr>\n" +
|
||||
|
||||
"<tr><td align=\"left\"><b>")
|
||||
.append(_("Share ratio"))
|
||||
.append(":</b></td><td align=\"right\">")
|
||||
.append(_helper.getShareRatio())
|
||||
.append("</td></tr>\n" +
|
||||
|
||||
"</table><hr><h3><a href=\"/jobs.jsp\" target=\"_top\" title=\"")
|
||||
|
||||
@@ -499,6 +499,15 @@ public class SummaryHelper extends HelperBase {
|
||||
return _context.tunnelManager().getParticipatingCount();
|
||||
}
|
||||
|
||||
/** @since 0.7.10 */
|
||||
public String getShareRatio() {
|
||||
if (_context == null)
|
||||
return "0";
|
||||
double sr = _context.tunnelManager().getShareRatio();
|
||||
DecimalFormat fmt = new DecimalFormat("##0.00");
|
||||
return fmt.format(sr);
|
||||
}
|
||||
|
||||
/**
|
||||
* How lagged our job queue is over the last minute (pretty printed with
|
||||
* the units attached)
|
||||
|
||||
Reference in New Issue
Block a user