本文整理汇总了Java中org.gudy.azureus2.core3.global.GlobalManagerStats类的典型用法代码示例。如果您正苦于以下问题:Java GlobalManagerStats类的具体用法?Java GlobalManagerStats怎么用?Java GlobalManagerStats使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GlobalManagerStats类属于org.gudy.azureus2.core3.global包,在下文中一共展示了GlobalManagerStats类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import org.gudy.azureus2.core3.global.GlobalManagerStats; //导入依赖的package包/类
public static void
initialize(
AzureusCore core,
GlobalManagerStats stats )
{
overall_stats = new OverallStatsImpl( core, stats );
longterm_stats = new LongTermStatsImpl( core, stats );
}
示例2: isDataFlowing
import org.gudy.azureus2.core3.global.GlobalManagerStats; //导入依赖的package包/类
private boolean isDataFlowing() {
if (core == null) {
return false;
}
GlobalManagerStats stats = core.getGlobalManager().getStats();
int dataSendRate = stats.getDataSendRate();
int dataReceiveRate = stats.getDataReceiveRate();
if (dataSendRate > 0 || dataReceiveRate > 0) {
// data flowing, no need to check smooth rate
return true;
}
long smoothedReceiveRate = stats.getSmoothedReceiveRate();
long smoothedSendRate = stats.getSmoothedSendRate();
return smoothedReceiveRate > 1024 && smoothedSendRate > 1024;
}
示例3: adjustMaxBandWidth
import org.gudy.azureus2.core3.global.GlobalManagerStats; //导入依赖的package包/类
/**
* @param configKey
* @return
*
* @since 3.0.1.7
*/
private static int adjustMaxBandWidth(int maxBandwidth,
GlobalManager globalManager, boolean up_menu) {
if(maxBandwidth == 0 && !up_menu )
{
GlobalManagerStats stats = globalManager.getStats();
int dataReceive = stats.getDataReceiveRate();
if (dataReceive < 1024) {
maxBandwidth = 275;
} else {
maxBandwidth = dataReceive / 1024;
}
}
return maxBandwidth;
}
示例4: refresh0
import org.gudy.azureus2.core3.global.GlobalManagerStats; //导入依赖的package包/类
protected void refresh0() {
GlobalManagerStats stats = g_manager.getStats();
this.updateSpeedLabel(down_speed, stats.getDataReceiveRate(),stats.getProtocolReceiveRate());
this.updateSpeedLabel(up_speed, stats.getDataSendRate(),stats.getProtocolSendRate());
long min_eta = Long.MAX_VALUE;
int num_downloading = 0;
List<DownloadManager> dms = g_manager.getDownloadManagers();
for ( DownloadManager dm: dms ){
if ( dm.getState() == DownloadManager.STATE_DOWNLOADING ){
num_downloading++;
long eta = dm.getStats().getSmoothedETA();
if ( eta < min_eta ){
min_eta = eta;
}
}
}
if ( min_eta == Long.MAX_VALUE ){
min_eta = Constants.CRAPPY_INFINITE_AS_LONG;
}
next_eta.setText(num_downloading==0?"":DisplayFormatters.formatETA(min_eta));
}