Class SpeedManagerAlgorithmProviderV2
- java.lang.Object
-
- com.biglybt.core.speedmanager.impl.v2.SpeedManagerAlgorithmProviderV2
-
- All Implemented Interfaces:
SpeedManagerAlgorithmProvider
public class SpeedManagerAlgorithmProviderV2 extends java.lang.Object implements SpeedManagerAlgorithmProvider
-
-
Field Summary
Fields Modifier and Type Field Description private SpeedManagerAlgorithmProviderAdapter
adapter
static java.lang.String
SETTING_DATA_SOURCE_INPUT
static java.lang.String
SETTING_DHT_BAD_SET_POINT
static java.lang.String
SETTING_DHT_BAD_TOLERANCE
static java.lang.String
SETTING_DHT_GOOD_SET_POINT
static java.lang.String
SETTING_DHT_GOOD_TOLERANCE
static java.lang.String
SETTING_DOWNLOAD_LIMIT_ESTIMATE_TYPE_FROM_UI
static java.lang.String
SETTING_DOWNLOAD_MAX_LIMIT
static java.lang.String
SETTING_INTERVALS_BETWEEN_ADJUST
static java.lang.String
SETTING_UPLOAD_LIMIT_ESTIMATE_TYPE_FROM_UI
static java.lang.String
SETTING_UPLOAD_MAX_LIMIT
static java.lang.String
SETTING_V2_BETA_ENABLED
static java.lang.String
SETTING_WAIT_AFTER_ADJUST
private SpeedManagerAlgorithmProvider
strategy
-
Fields inherited from interface com.biglybt.core.speedmanager.impl.SpeedManagerAlgorithmProvider
UPDATE_PERIOD_MILLIS
-
-
Constructor Summary
Constructors Constructor Description SpeedManagerAlgorithmProviderV2(SpeedManagerAlgorithmProviderAdapter _adapter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calculate(SpeedManagerPingSource[] sources)
Called whenever a new set of ping values is available for processingvoid
destroy()
boolean
getAdjustsDownloadLimits()
Indicates whether or not the provider is adjusting download as well as upload limitsint
getCurrentChokeSpeed()
Returns the current view of when choking occursint
getCurrentPingMillis()
int
getIdlePingMillis()
Various getters for interesting info shown in stats viewint
getMaxPingMillis()
int
getMaxUploadSpeed()
protected void
log(java.lang.String str)
void
pingSourceFailed(SpeedManagerPingSource source)
Ping source has failedvoid
pingSourceFound(SpeedManagerPingSource source, boolean is_replacement)
Called when a new source of ping times has been foundvoid
reset()
Reset any state to start of day valuesvoid
updateStats()
Called periodically (see period above) to allow stats to be updated.
-
-
-
Field Detail
-
adapter
private final SpeedManagerAlgorithmProviderAdapter adapter
-
strategy
private final SpeedManagerAlgorithmProvider strategy
-
SETTING_DOWNLOAD_MAX_LIMIT
public static final java.lang.String SETTING_DOWNLOAD_MAX_LIMIT
- See Also:
- Constant Field Values
-
SETTING_UPLOAD_MAX_LIMIT
public static final java.lang.String SETTING_UPLOAD_MAX_LIMIT
- See Also:
- Constant Field Values
-
SETTING_UPLOAD_LIMIT_ESTIMATE_TYPE_FROM_UI
public static final java.lang.String SETTING_UPLOAD_LIMIT_ESTIMATE_TYPE_FROM_UI
- See Also:
- Constant Field Values
-
SETTING_DOWNLOAD_LIMIT_ESTIMATE_TYPE_FROM_UI
public static final java.lang.String SETTING_DOWNLOAD_LIMIT_ESTIMATE_TYPE_FROM_UI
- See Also:
- Constant Field Values
-
SETTING_DATA_SOURCE_INPUT
public static final java.lang.String SETTING_DATA_SOURCE_INPUT
- See Also:
- Constant Field Values
-
SETTING_DHT_GOOD_SET_POINT
public static final java.lang.String SETTING_DHT_GOOD_SET_POINT
- See Also:
- Constant Field Values
-
SETTING_DHT_GOOD_TOLERANCE
public static final java.lang.String SETTING_DHT_GOOD_TOLERANCE
- See Also:
- Constant Field Values
-
SETTING_DHT_BAD_SET_POINT
public static final java.lang.String SETTING_DHT_BAD_SET_POINT
- See Also:
- Constant Field Values
-
SETTING_DHT_BAD_TOLERANCE
public static final java.lang.String SETTING_DHT_BAD_TOLERANCE
- See Also:
- Constant Field Values
-
SETTING_WAIT_AFTER_ADJUST
public static final java.lang.String SETTING_WAIT_AFTER_ADJUST
- See Also:
- Constant Field Values
-
SETTING_INTERVALS_BETWEEN_ADJUST
public static final java.lang.String SETTING_INTERVALS_BETWEEN_ADJUST
- See Also:
- Constant Field Values
-
SETTING_V2_BETA_ENABLED
public static final java.lang.String SETTING_V2_BETA_ENABLED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SpeedManagerAlgorithmProviderV2
public SpeedManagerAlgorithmProviderV2(SpeedManagerAlgorithmProviderAdapter _adapter)
-
-
Method Detail
-
destroy
public void destroy()
- Specified by:
destroy
in interfaceSpeedManagerAlgorithmProvider
-
reset
public void reset()
Description copied from interface:SpeedManagerAlgorithmProvider
Reset any state to start of day values- Specified by:
reset
in interfaceSpeedManagerAlgorithmProvider
-
updateStats
public void updateStats()
Description copied from interface:SpeedManagerAlgorithmProvider
Called periodically (see period above) to allow stats to be updated.- Specified by:
updateStats
in interfaceSpeedManagerAlgorithmProvider
-
pingSourceFound
public void pingSourceFound(SpeedManagerPingSource source, boolean is_replacement)
Description copied from interface:SpeedManagerAlgorithmProvider
Called when a new source of ping times has been found- Specified by:
pingSourceFound
in interfaceSpeedManagerAlgorithmProvider
is_replacement
- One of the initial sources or a replacement for a failed one
-
pingSourceFailed
public void pingSourceFailed(SpeedManagerPingSource source)
Description copied from interface:SpeedManagerAlgorithmProvider
Ping source has failed- Specified by:
pingSourceFailed
in interfaceSpeedManagerAlgorithmProvider
-
calculate
public void calculate(SpeedManagerPingSource[] sources)
Description copied from interface:SpeedManagerAlgorithmProvider
Called whenever a new set of ping values is available for processing- Specified by:
calculate
in interfaceSpeedManagerAlgorithmProvider
-
getIdlePingMillis
public int getIdlePingMillis()
Description copied from interface:SpeedManagerAlgorithmProvider
Various getters for interesting info shown in stats view- Specified by:
getIdlePingMillis
in interfaceSpeedManagerAlgorithmProvider
- Returns:
-
getCurrentPingMillis
public int getCurrentPingMillis()
- Specified by:
getCurrentPingMillis
in interfaceSpeedManagerAlgorithmProvider
-
getMaxPingMillis
public int getMaxPingMillis()
- Specified by:
getMaxPingMillis
in interfaceSpeedManagerAlgorithmProvider
-
getCurrentChokeSpeed
public int getCurrentChokeSpeed()
Description copied from interface:SpeedManagerAlgorithmProvider
Returns the current view of when choking occurs- Specified by:
getCurrentChokeSpeed
in interfaceSpeedManagerAlgorithmProvider
- Returns:
- speed in bytes/sec
-
getMaxUploadSpeed
public int getMaxUploadSpeed()
- Specified by:
getMaxUploadSpeed
in interfaceSpeedManagerAlgorithmProvider
-
getAdjustsDownloadLimits
public boolean getAdjustsDownloadLimits()
Description copied from interface:SpeedManagerAlgorithmProvider
Indicates whether or not the provider is adjusting download as well as upload limits- Specified by:
getAdjustsDownloadLimits
in interfaceSpeedManagerAlgorithmProvider
- Returns:
-
log
protected void log(java.lang.String str)
-
-