* Console: Add a tunnel share ratio estimate

This commit is contained in:
zzz
2010-01-18 14:57:03 +00:00
parent f8d9af871a
commit 5f12688a90
6 changed files with 46 additions and 1 deletions

View File

@@ -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=\"")

View File

@@ -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)