use of com.biglybt.core.dht.transport.DHTTransport in project BiglyBT by BiglySoftware.
the class DHTView method refreshGeneral.
private void refreshGeneral() {
DHTControlStats controlStats = dht.getControl().getStats();
DHTRouterStats routerStats = dht.getRouter().getStats();
DHTTransport transport = dht.getTransport();
DHTTransportStats transportStats = transport.getStats();
lblUpTime.setText(TimeFormatter.format(controlStats.getRouterUptime() / 1000));
lblNumberOfUsers.setText("" + controlStats.getEstimatedDHTSize());
int percent = transportStats.getRouteablePercentage();
lblReachable.setText((transport.isReachable() ? yes_str : no_str) + (percent == -1 ? "" : (" " + percent + "%")));
DHTNATPuncher puncher = dht.getNATPuncher();
String puncher_str;
if (puncher == null) {
puncher_str = "";
} else {
puncher_str = puncher.operational() ? yes_str : no_str;
}
lblRendezvous.setText(transport.isReachable() ? "" : puncher_str);
long[] stats = routerStats.getStats();
lblNodes.setText("" + stats[DHTRouterStats.ST_NODES]);
lblLeaves.setText("" + stats[DHTRouterStats.ST_LEAVES]);
lblContacts.setText("" + stats[DHTRouterStats.ST_CONTACTS]);
lblReplacements.setText("" + stats[DHTRouterStats.ST_REPLACEMENTS]);
lblLive.setText("" + stats[DHTRouterStats.ST_CONTACTS_LIVE]);
lblUnknown.setText("" + stats[DHTRouterStats.ST_CONTACTS_UNKNOWN]);
lblDying.setText("" + stats[DHTRouterStats.ST_CONTACTS_DEAD]);
long skew_average = transportStats.getSkewAverage();
lblSkew.setText(skew_average == 0 ? "" : (skew_average < 0 ? "-" : "") + TimeFormatter.format100ths(Math.abs(skew_average)));
}
use of com.biglybt.core.dht.transport.DHTTransport in project BiglyBT by BiglySoftware.
the class DHTControlStatsImpl method update.
protected void update() {
DHTTransport transport = control.getTransport();
DHTTransportStats t_stats = transport.getStats().snapshot();
packets_in_average.addValue(t_stats.getPacketsReceived() - transport_snapshot.getPacketsReceived());
packets_out_average.addValue(t_stats.getPacketsSent() - transport_snapshot.getPacketsSent());
bytes_in_average.addValue(t_stats.getBytesReceived() - transport_snapshot.getBytesReceived());
bytes_out_average.addValue(t_stats.getBytesSent() - transport_snapshot.getBytesSent());
transport_snapshot = t_stats;
router_snapshot = control.getRouter().getStats().getStats();
value_details_snapshot = null;
}
Aggregations