more valid display of bw usage (but not as fresh)
This commit is contained in:
@ -285,7 +285,7 @@ public class Router {
|
|||||||
RateStat sendRate = _context.statManager().getRate("transport.sendMessageSize");
|
RateStat sendRate = _context.statManager().getRate("transport.sendMessageSize");
|
||||||
for (int i = 0; i < sendRate.getPeriods().length; i++) {
|
for (int i = 0; i < sendRate.getPeriods().length; i++) {
|
||||||
Rate rate = sendRate.getRate(sendRate.getPeriods()[i]);
|
Rate rate = sendRate.getRate(sendRate.getPeriods()[i]);
|
||||||
double bytes = rate.getLastTotalValue() + rate.getCurrentTotalValue();
|
double bytes = rate.getLastTotalValue();
|
||||||
long ms = rate.getLastTotalEventTime() + rate.getLastTotalEventTime();
|
long ms = rate.getLastTotalEventTime() + rate.getLastTotalEventTime();
|
||||||
if (ms <= 0) {
|
if (ms <= 0) {
|
||||||
bytes = 0;
|
bytes = 0;
|
||||||
@ -303,9 +303,7 @@ public class Router {
|
|||||||
buf.append(" over ").append((long)bytes).append(" bytes");
|
buf.append(" over ").append((long)bytes).append(" bytes");
|
||||||
buf.append("</li><li>");
|
buf.append("</li><li>");
|
||||||
buf.append(DataHelper.formatDuration(rate.getPeriod())).append(" period send avg: ");
|
buf.append(DataHelper.formatDuration(rate.getPeriod())).append(" period send avg: ");
|
||||||
// we include lastPeriod + current *partial* period, and jrandom is too lazy to calculate how
|
bps = bytes*1000.0d/(rate.getPeriod());
|
||||||
// much of that partial is contained here, so 2*period it is.
|
|
||||||
bps = bytes*1000.0d/(2*rate.getPeriod());
|
|
||||||
if (bps > 2048) {
|
if (bps > 2048) {
|
||||||
bps /= 1024.0d;
|
bps /= 1024.0d;
|
||||||
buf.append(fmt.format(bps)).append(" KBps");
|
buf.append(fmt.format(bps)).append(" KBps");
|
||||||
@ -337,8 +335,6 @@ public class Router {
|
|||||||
buf.append(" over ").append((long)bytes).append(" bytes");
|
buf.append(" over ").append((long)bytes).append(" bytes");
|
||||||
buf.append("</li><li>");
|
buf.append("</li><li>");
|
||||||
buf.append(DataHelper.formatDuration(rate.getPeriod())).append(" period receive avg: ");
|
buf.append(DataHelper.formatDuration(rate.getPeriod())).append(" period receive avg: ");
|
||||||
// we include lastPeriod + current *partial* period, and jrandom is too lazy to calculate how
|
|
||||||
// much of that partial is contained here, so 2*period it is.
|
|
||||||
bps = bytes*1000.0d/(rate.getPeriod());
|
bps = bytes*1000.0d/(rate.getPeriod());
|
||||||
if (bps > 2048) {
|
if (bps > 2048) {
|
||||||
bps /= 1024.0d;
|
bps /= 1024.0d;
|
||||||
|
Reference in New Issue
Block a user