Search in sources :

Example 11 with SpeedManagerLimitEstimate

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);
    }
}
Also used : SpeedManagerAlgorithmProviderAdapter(com.biglybt.core.speedmanager.impl.SpeedManagerAlgorithmProviderAdapter) SpeedManagerLimitEstimate(com.biglybt.core.speedmanager.SpeedManagerLimitEstimate) LogEvent(com.biglybt.core.logging.LogEvent)

Example 12 with SpeedManagerLimitEstimate

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);
}
Also used : SpeedManagerLimitEstimate(com.biglybt.core.speedmanager.SpeedManagerLimitEstimate)

Example 13 with SpeedManagerLimitEstimate

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;
        }
    }
}
Also used : SpeedManagerAlgorithmProviderAdapter(com.biglybt.core.speedmanager.impl.SpeedManagerAlgorithmProviderAdapter) SpeedManagerLimitEstimate(com.biglybt.core.speedmanager.SpeedManagerLimitEstimate) SpeedManagerPingMapper(com.biglybt.core.speedmanager.SpeedManagerPingMapper)

Example 14 with SpeedManagerLimitEstimate

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;
}
Also used : SpeedManager(com.biglybt.core.speedmanager.SpeedManager) SpeedManagerAlgorithmProviderAdapter(com.biglybt.core.speedmanager.impl.SpeedManagerAlgorithmProviderAdapter) SpeedManagerLimitEstimate(com.biglybt.core.speedmanager.SpeedManagerLimitEstimate)

Example 15 with SpeedManagerLimitEstimate

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);
    }
}
Also used : SpeedManagerLimitEstimate(com.biglybt.core.speedmanager.SpeedManagerLimitEstimate) SpeedManagerPingMapper(com.biglybt.core.speedmanager.SpeedManagerPingMapper)

Aggregations

SpeedManagerLimitEstimate (com.biglybt.core.speedmanager.SpeedManagerLimitEstimate)22 SpeedManagerAlgorithmProviderAdapter (com.biglybt.core.speedmanager.impl.SpeedManagerAlgorithmProviderAdapter)9 SpeedManagerPingMapper (com.biglybt.core.speedmanager.SpeedManagerPingMapper)7 SpeedManager (com.biglybt.core.speedmanager.SpeedManager)6 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 Label (org.eclipse.swt.widgets.Label)2 LogEvent (com.biglybt.core.logging.LogEvent)1 PEPeerManager (com.biglybt.core.peer.PEPeerManager)1 PEPeerManagerStats (com.biglybt.core.peer.PEPeerManagerStats)1 LimitToTextHelper (com.biglybt.core.speedmanager.LimitToTextHelper)1 SpeedManagerListener (com.biglybt.core.speedmanager.SpeedManagerListener)1 Parameter (com.biglybt.pif.ui.config.Parameter)1 TransferStatsView (com.biglybt.ui.swt.views.stats.TransferStatsView)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 MouseAdapter (org.eclipse.swt.events.MouseAdapter)1 MouseEvent (org.eclipse.swt.events.MouseEvent)1