protected String getStatsTrace() {
   String n = peer.getManager().getDisplayName();
   String t = session_type == TYPE_DOWNLOAD ? "DOWNLOADING" : "SEEDING";
   String p = " : [" + peer.getClient() + "] " + peer.getIp() + " :" + peer.getPort();
   String s =
       " || (D: "
           + DisplayFormatters.formatByteCountToKiBEtcPerSec(peer.getStats().getDataReceiveRate())
           + ") (U: "
           + DisplayFormatters.formatByteCountToKiBEtcPerSec(peer.getStats().getDataSendRate())
           + ")";
   return "[" + n + "] " + t + p + s;
 }
Пример #2
0
  public void refresh(TableCell cell) {
    DownloadManager dm = (DownloadManager) cell.getDataSource();
    long value = (dm == null) ? 0 : dm.getEffectiveUploadRateLimitBytesPerSecond();
    if (!cell.setSortValue(value) && cell.isValid()) return;

    if (value == -1) {
      cell.setText(MessageText.getString("MyTorrents.items.UpSpeedLimit.disabled"));
    } else if (value == 0) {
      cell.setText(Constants.INFINITY_STRING);
    } else {
      cell.setText(DisplayFormatters.formatByteCountToKiBEtcPerSec(value));
    }
  }