use of com.biglybt.core.dht.DHTStorageAdapter in project BiglyBT by BiglySoftware.
the class DHTView method refreshDB.
private void refreshDB() {
if (refreshIter == 0) {
DHTDBStats dbStats = dht.getDataBase().getStats();
lblKeys.setText("" + dbStats.getKeyCount() + " (" + dbStats.getLocalKeyCount() + ")");
int[] stats = dbStats.getValueDetails();
lblValues.setText("" + stats[DHTDBStats.VD_VALUE_COUNT]);
lblSize.setText(DisplayFormatters.formatByteCountToKiBEtc(dbStats.getSize()));
lblDirect.setText(DisplayFormatters.formatByteCountToKiBEtc(stats[DHTDBStats.VD_DIRECT_SIZE]));
lblIndirect.setText(DisplayFormatters.formatByteCountToKiBEtc(stats[DHTDBStats.VD_INDIRECT_SIZE]));
lblLocal.setText(DisplayFormatters.formatByteCountToKiBEtc(stats[DHTDBStats.VD_LOCAL_SIZE]));
DHTStorageAdapter sa = dht.getStorageAdapter();
String rem_freq;
String rem_size;
if (sa == null) {
rem_freq = "-";
rem_size = "-";
} else {
rem_freq = "" + sa.getRemoteFreqDivCount();
rem_size = "" + sa.getRemoteSizeDivCount();
}
lblDivFreq.setText("" + stats[DHTDBStats.VD_DIV_FREQ] + " (" + rem_freq + ")");
lblDivSize.setText("" + stats[DHTDBStats.VD_DIV_SIZE] + " (" + rem_size + ")");
} else {
refreshIter++;
if (refreshIter == 100)
refreshIter = 0;
}
}
Aggregations