|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.aelitis.azureus.core.speedmanager.impl.v2.SpeedLimitMonitor
public class SpeedLimitMonitor
This class is responsible for re-adjusting the limits used by AutoSpeedV2. This class will keep track of the "status" (i.e. seeding, downloading)of the application. It will then re-adjust the MAX limits when it thinks limits are being reached. Here are the rules it will use. #1) When seeding. If the upload is AT_LIMIT for a period of time it will allow that to adjust upward. #2) When downloading. If the download is AT_LIMIT for a period of time it will allow that to adjust upward. #3) When downloading, if a down-tick is detected and the upload is near a limit, it will drop the upload limit to 80% of MAX_UPLOAD. #4) Once that limit is reached it will drop both the upload and download limits together. #5) Seeding mode is triggered when - download bandwidth at LOW - compared to CAPACITY for 5 minutes continously. #6) Download mode is triggered when - download bandwidth reaches MEDIUM - compared to CURRENT_LIMIT for the first time. Rules #5 and #6 favor downloading over seeding.
Field Summary | |
---|---|
static java.lang.String |
DOWNLOAD_CONF_LIMIT_SETTING
|
static java.lang.String |
UPLOAD_CHOKE_PING_COUNT
|
static java.lang.String |
UPLOAD_CONF_LIMIT_SETTING
|
static java.lang.String |
USED_UPLOAD_CAPACITY_DOWNLOAD_MODE
|
static java.lang.String |
USED_UPLOAD_CAPACITY_SEEDING_MODE
|
Constructor Summary | |
---|---|
SpeedLimitMonitor(SpeedManager sm)
|
Method Summary | |
---|---|
void |
addToPingMapData(int lastMetricValue)
|
SMUpdate |
adjustLimitsToSpec(int currUploadLimit,
int currDownloadLimit)
It is likely the user adjusted the "line speed capacity" on the configuration panel. |
boolean |
areSettingsInSpec(int currUploadLimit,
int currDownloadLimit)
If the user changes the line capacity settings on the configuration panel and adjustment needs to occur even if the signal is NO-CHANGE-NEEDED. |
boolean |
bandwidthUsageAtLimit()
True if both are at limits. |
boolean |
bandwidthUsageLow()
Are both the upload and download bandwidths usages is low? Otherwise false. |
boolean |
bandwidthUsageMedium()
|
void |
betaLogPingMapperEstimates(java.lang.String name,
SpeedManagerLimitEstimate transEst,
boolean hadChockPing,
SpeedManagerLimitEstimate permEst,
PingSpaceMapper downMode,
PingSpaceMapper seedMode)
This is a lot of data, but is important debug info. |
SMUpdate |
calculateNewUnpinnedLimits(float signalStrength)
|
void |
checkForUnpinningCondition()
Make a decision about unpinning either the upload or download limit. |
SpeedLimitConfidence |
determineConfidenceLevel()
After a test is complete determine how condifent the client should be in it based on how different it is from the previous result. |
SMUpdate |
endLimitTesting()
Call this method to end the limit testing. |
SMUpdate |
endLimitTesting(int downloadCapacityGuess,
int uploadCapacityGuess)
|
SaturatedMode |
getDownloadBandwidthMode()
|
java.lang.String |
getDownloadConfidence()
|
SaturatedMode |
getDownloadLimitSettingMode()
|
int |
getDownloadMaxLimit()
|
int |
getDownloadMinLimit()
|
TransferMode |
getTransferMode()
|
java.lang.String |
getTransferModeAsString()
|
SaturatedMode |
getUploadBandwidthMode()
|
java.lang.String |
getUploadConfidence()
|
SaturatedMode |
getUploadLimitSettingMode()
|
int |
getUploadMaxLimit()
|
int |
getUploadMinLimit()
|
int |
guessDownloadLimit()
|
int |
guessUploadLimit()
|
boolean |
hadChockingPing()
Should return true if had a recent chocking ping. |
void |
initPingSpaceMap()
|
void |
initPingSpaceMap(int maxGoodPing,
int minBadPing)
|
boolean |
isConfLimitTestFinished()
|
boolean |
isConfTestingLimits()
Return true if we are confidence testing the limits. |
boolean |
isDownloadConfidenceAbsolute()
|
boolean |
isDownloadConfidenceLow()
Determine if we have low confidence in this limit. |
boolean |
isEitherLimitUnpinned()
|
boolean |
isStartLimitTestFlagSet()
|
boolean |
isUploadBandwidthUsageHigh()
True if the upload bandwidth usage is HIGH or AT_LIMIT. |
boolean |
isUploadConfidenceAbsolute()
|
boolean |
isUploadConfidenceLow()
|
protected void |
log(java.lang.String str)
|
void |
logPingMapData()
Just log this data until we decide if it is useful. |
void |
logPMDataEx()
|
SMUpdate |
modifyLimits(float signalStrength,
float multiple,
int currUpLimit,
int currDownLimit)
Does the same as createNewLimit except it drops the upload rate first when in download mode. |
void |
notifyDownload(SpeedManagerLimitEstimate estimate)
|
void |
notifyOfDownSignal()
If we have a down-tick signal then resetTimer all the counters for increasing the limits. |
void |
notifyUpload(SpeedManagerLimitEstimate estimate)
|
SMUpdate |
rampTestingLimit(int uploadLimit,
int downloadLimit)
Ramp the upload and download rates higher, so ping-times are relevant. |
void |
readFromPersistentMap()
replaces - updateFromCOConfigManager() |
void |
resetPingSpace()
|
void |
saveToCOConfiguration()
|
void |
setCurrentTransferRates(int downRate,
int upRate)
|
void |
setDownloadBandwidthMode(int rate,
int limit)
|
void |
setDownloadLimitSettingMode(int currLimit)
|
void |
setRefLimits(int uploadMax,
int downloadMax)
|
void |
setRefLimits(SpeedManagerLimitEstimate estUp,
SpeedManagerLimitEstimate estDown)
Make some choices about how usable the limits are before passing them on. |
void |
setUploadBandwidthMode(int rate,
int limit)
|
void |
setUploadLimitSettingMode(int currLimit)
|
SMUpdate |
startLimitTesting(int currUploadLimit,
int currDownloadLimit)
Call this method to start the limit testing. |
void |
triggerLimitTestingFlag()
|
void |
updateFromCOConfigManager()
|
void |
updateLimitTestingData(int downloadRate,
int uploadRate)
|
void |
updateLimitTestingPing(float lastMetric)
New metric from the PingMapper is value between -1.0 and +1.0f. |
void |
updateLimitTestingPing(int lastMetric)
Convert raw ping value to new metric. |
void |
updateSettingsFromCOConfigManager()
Splitting the limits our from other setting for SpeedManagerAlgorithmTI. |
void |
updateTransferMode()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String UPLOAD_CONF_LIMIT_SETTING
public static final java.lang.String DOWNLOAD_CONF_LIMIT_SETTING
public static final java.lang.String UPLOAD_CHOKE_PING_COUNT
public static final java.lang.String USED_UPLOAD_CAPACITY_DOWNLOAD_MODE
public static final java.lang.String USED_UPLOAD_CAPACITY_SEEDING_MODE
Constructor Detail |
---|
public SpeedLimitMonitor(SpeedManager sm)
Method Detail |
---|
public void updateSettingsFromCOConfigManager()
public void updateFromCOConfigManager()
public void readFromPersistentMap()
public void saveToCOConfiguration()
public void logPMDataEx()
public void setDownloadBandwidthMode(int rate, int limit)
public void setUploadBandwidthMode(int rate, int limit)
public void setDownloadLimitSettingMode(int currLimit)
public void setUploadLimitSettingMode(int currLimit)
public int getUploadMaxLimit()
public int getDownloadMaxLimit()
public int getUploadMinLimit()
public int getDownloadMinLimit()
public java.lang.String getUploadConfidence()
public java.lang.String getDownloadConfidence()
public SaturatedMode getDownloadBandwidthMode()
public SaturatedMode getUploadBandwidthMode()
public SaturatedMode getDownloadLimitSettingMode()
public SaturatedMode getUploadLimitSettingMode()
public void updateTransferMode()
public java.lang.String getTransferModeAsString()
public TransferMode getTransferMode()
public boolean bandwidthUsageLow()
public boolean bandwidthUsageMedium()
public boolean bandwidthUsageAtLimit()
public boolean isUploadBandwidthUsageHigh()
public boolean isEitherLimitUnpinned()
public SMUpdate modifyLimits(float signalStrength, float multiple, int currUpLimit, int currDownLimit)
signalStrength
- -multiple
- -currUpLimit
- -currDownLimit
- -
public SMUpdate calculateNewUnpinnedLimits(float signalStrength)
signalStrength
- -
public void checkForUnpinningCondition()
public void notifyOfDownSignal()
public boolean isConfTestingLimits()
public boolean isDownloadConfidenceLow()
public boolean isUploadConfidenceLow()
public boolean isDownloadConfidenceAbsolute()
public boolean isUploadConfidenceAbsolute()
public void updateLimitTestingData(int downloadRate, int uploadRate)
downloadRate
- - currentUploadRate in bytes/secuploadRate
- - currentUploadRate in bytes/secpublic void updateLimitTestingPing(int lastMetric)
lastMetric
- -public void updateLimitTestingPing(float lastMetric)
lastMetric
- -public SMUpdate startLimitTesting(int currUploadLimit, int currDownloadLimit)
currUploadLimit
- -currDownloadLimit
- -
public SMUpdate rampTestingLimit(int uploadLimit, int downloadLimit)
uploadLimit
- -downloadLimit
- -
public void triggerLimitTestingFlag()
public boolean isStartLimitTestFlagSet()
public boolean isConfLimitTestFinished()
public SMUpdate endLimitTesting(int downloadCapacityGuess, int uploadCapacityGuess)
public SMUpdate endLimitTesting()
public SpeedLimitConfidence determineConfidenceLevel()
public boolean areSettingsInSpec(int currUploadLimit, int currDownloadLimit)
currUploadLimit
- - reported upload capacity from the adaptercurrDownloadLimit
- - reported download capacity from the adapter.
public void setRefLimits(SpeedManagerLimitEstimate estUp, SpeedManagerLimitEstimate estDown)
estUp
- -estDown
- -public void setRefLimits(int uploadMax, int downloadMax)
public SMUpdate adjustLimitsToSpec(int currUploadLimit, int currDownloadLimit)
currUploadLimit
- -currDownloadLimit
- -
protected void log(java.lang.String str)
public void initPingSpaceMap(int maxGoodPing, int minBadPing)
public void initPingSpaceMap()
public void betaLogPingMapperEstimates(java.lang.String name, SpeedManagerLimitEstimate transEst, boolean hadChockPing, SpeedManagerLimitEstimate permEst, PingSpaceMapper downMode, PingSpaceMapper seedMode)
name
- -transEst
- -hadChockPing
- -permEst
- -downMode
- -seedMode
- -public int guessDownloadLimit()
public int guessUploadLimit()
public boolean hadChockingPing()
public void logPingMapData()
public void setCurrentTransferRates(int downRate, int upRate)
public void resetPingSpace()
public void addToPingMapData(int lastMetricValue)
public void notifyUpload(SpeedManagerLimitEstimate estimate)
notifyUpload
in interface PSMonitorListener
public void notifyDownload(SpeedManagerLimitEstimate estimate)
notifyDownload
in interface PSMonitorListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |