use of com.biglybt.core.speedmanager.impl.SpeedManagerAlgorithmProviderAdapter in project BiglyBT by BiglySoftware.
the class SpeedLimitMonitor method guessDownloadLimit.
// betaLogPingMapperEstimates
public int guessDownloadLimit() {
if (!useVariancePingMap) {
return pingMapOfDownloadMode.guessDownloadLimit();
} else {
boolean wasChocked = true;
SpeedManagerLimitEstimate transientEst = null;
if (transientPingMap != null) {
transientEst = transientPingMap.getLastBadDownloadLimit();
if (transientEst == null) {
wasChocked = false;
transientEst = transientPingMap.getEstimatedDownloadLimit(false);
}
}
// NOTE: Currently just getting the persistentMap for temp logging purposes.
SMInstance pm = SMInstance.getInstance();
SpeedManagerAlgorithmProviderAdapter adapter = pm.getAdapter();
SpeedManagerPingMapper persistentMap = adapter.getPingMapper();
SpeedManagerLimitEstimate persistentEst = persistentMap.getEstimatedDownloadLimit(false);
// log the different ping-mappers for beta.
betaLogPingMapperEstimates("down", transientEst, wasChocked, persistentEst, pingMapOfDownloadMode, pingMapOfSeedingMode);
if (transientEst != null) {
return choseBestLimit(transientEst, downloadLimitMax, downloadLimitConf);
} else {
return downloadLimitMax;
}
}
}
use of com.biglybt.core.speedmanager.impl.SpeedManagerAlgorithmProviderAdapter in project BiglyBT by BiglySoftware.
the class SpeedLimitMonitor method isSettingDownloadUnlimited.
// logPMDataEx
/**
* The criteria for download being unlimited is if the ConfigPanel has the
* "download == 0 " && "type==fixed"
* @return - true
*/
private boolean isSettingDownloadUnlimited() {
SpeedManagerAlgorithmProviderAdapter adpter = SMInstance.getInstance().getAdapter();
SpeedManager sm = adpter.getSpeedManager();
SpeedManagerLimitEstimate dEst = sm.getEstimatedDownloadCapacityBytesPerSec();
int rate = dEst.getBytesPerSec();
float type = dEst.getEstimateType();
// user or plug-in want the download rate unlimited.
if (rate == 0 && type == SpeedManagerLimitEstimate.TYPE_MANUAL) {
return true;
}
// start the search in unlimited mode.
if (rate == 0 && type == SpeedManagerLimitEstimate.TYPE_UNKNOWN) {
return true;
}
return false;
}
use of com.biglybt.core.speedmanager.impl.SpeedManagerAlgorithmProviderAdapter in project BiglyBT by BiglySoftware.
the class SpeedLimitMonitor method triggerLimitTestingFlag.
// rampTestingLimit
public void triggerLimitTestingFlag() {
SpeedManagerLogger.trace("triggerd fast limit test.");
beginLimitTest = true;
// if we are using a persistent PingSource then get that here.
if (useVariancePingMap) {
SMInstance pm = SMInstance.getInstance();
SpeedManagerAlgorithmProviderAdapter adapter = pm.getAdapter();
// start a new transientPingMap;
if (transientPingMap != null) {
transientPingMap.destroy();
}
transientPingMap = adapter.createTransientPingMapper();
}
}
use of com.biglybt.core.speedmanager.impl.SpeedManagerAlgorithmProviderAdapter in project BiglyBT by BiglySoftware.
the class PingSpaceMon method getUploadEstCapacity.
// getUploadLimit
public static SpeedManagerLimitEstimate getUploadEstCapacity() {
try {
SMInstance pm = SMInstance.getInstance();
SpeedManagerAlgorithmProviderAdapter adapter = pm.getAdapter();
SpeedManager sm = adapter.getSpeedManager();
SpeedManagerLimitEstimate upEstCapacity = sm.getEstimatedUploadCapacityBytesPerSec();
return upEstCapacity;
} catch (Throwable t) {
// log this event and
SpeedManagerLogger.log(t.toString());
t.printStackTrace();
// something to return 1 and -1.0f results.
return new DefaultLimitEstimate();
}
}
use of com.biglybt.core.speedmanager.impl.SpeedManagerAlgorithmProviderAdapter in project BiglyBT by BiglySoftware.
the class PingSpaceMon method getUploadLimit.
/**
* Get the current estimated upload limit from the ping mapper.
* @param - true if the long-term persistent result should be used.
* @return - SpeedManagerLimitEstimate.
*/
public static SpeedManagerLimitEstimate getUploadLimit(boolean persistent) {
try {
SMInstance pm = SMInstance.getInstance();
SpeedManagerAlgorithmProviderAdapter adapter = pm.getAdapter();
SpeedManagerPingMapper persistentMap = adapter.getPingMapper();
SpeedManagerLimitEstimate upEst = persistentMap.getEstimatedUploadLimit(true);
return upEst;
} catch (Throwable t) {
// log this event and
SpeedManagerLogger.log(t.toString());
t.printStackTrace();
// something to return 1 and -1.0f results.
return new DefaultLimitEstimate();
}
}
Aggregations