use of com.biglybt.core.speedmanager.SpeedManagerLimitEstimate in project BiglyBT by BiglySoftware.
the class SMSearchLogger method log.
public static void log(String str) {
// get the adapter values.
SpeedManagerAlgorithmProviderAdapter adpter = SMInstance.getInstance().getAdapter();
int adptCurrUpLimit = adpter.getCurrentUploadLimit();
int adptCurrDownLimit = adpter.getCurrentDownloadLimit();
// get the COConfigurationManager values.
SMConfigurationAdapter conf = SMInstance.getInstance().getConfigManager();
SpeedManagerLimitEstimate uploadSetting = conf.getUploadLimit();
SpeedManagerLimitEstimate downloadSetting = conf.getDownloadLimit();
StringBuilder sb = new StringBuilder(str);
sb.append(", Download current =").append(adptCurrDownLimit);
sb.append(", max limit =").append(downloadSetting.getString());
sb.append(", Upload current = ").append(adptCurrUpLimit);
sb.append(", max limit = ").append(uploadSetting.getString());
String msg = sb.toString();
LogEvent e = new LogEvent(ID, msg);
Logger.log(e);
if (dLog != null) {
dLog.log(msg);
}
}
use of com.biglybt.core.speedmanager.SpeedManagerLimitEstimate in project BiglyBT by BiglySoftware.
the class SpeedLimitMonitor method setRefLimits.
/**
* Make some choices about how usable the limits are before passing them on.
* @param estUp -
* @param estDown -
*/
public void setRefLimits(SpeedManagerLimitEstimate estUp, SpeedManagerLimitEstimate estDown) {
SpeedManagerLimitEstimate up = SMConst.filterEstimate(estUp, SMConst.MIN_UPLOAD_BYTES_PER_SEC);
int upMax = choseBestLimit(up, uploadLimitMax, uploadLimitConf);
SpeedManagerLimitEstimate down = SMConst.filterEstimate(estDown, SMConst.MIN_DOWNLOAD_BYTES_PER_SEC);
int downMax = choseBestLimit(down, downloadLimitMax, downloadLimitConf);
if (downMax < upMax) {
SpeedManagerLogger.trace("down max-limit was less then up-max limit. increasing down max-limit. upMax=" + upMax + " downMax=" + downMax);
downMax = upMax;
}
setRefLimits(upMax, downMax);
}
use of com.biglybt.core.speedmanager.SpeedManagerLimitEstimate 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.SpeedManagerLimitEstimate 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.SpeedManagerLimitEstimate in project BiglyBT by BiglySoftware.
the class SpeedLimitMonitor method hadChockingPing.
// guessUploadLimit
/**
* Should return true if had a recent chocking ping.
* @return - true if
*/
public boolean hadChockingPing() {
if (!useVariancePingMap) {
return pingMapOfDownloadMode.hadChockingPing(true);
} else {
SpeedManagerPingMapper pm = SMInstance.getInstance().getAdapter().getPingMapper();
// if either had a choking ping.
SpeedManagerLimitEstimate dEst = pm.getEstimatedDownloadLimit(true);
SpeedManagerLimitEstimate uEst = pm.getEstimatedUploadLimit(true);
boolean hadChokePingUp = (uEst.getEstimateType() == SpeedManagerLimitEstimate.TYPE_CHOKE_ESTIMATED);
boolean hadChokePingDown = (dEst.getEstimateType() == SpeedManagerLimitEstimate.TYPE_CHOKE_ESTIMATED);
return (hadChokePingUp || hadChokePingDown);
}
}
Aggregations