Class SpeedManagerAlgorithmProviderV1
java.lang.Object
com.biglybt.core.speedmanager.impl.v1.SpeedManagerAlgorithmProviderV1
- All Implemented Interfaces:
SpeedManagerAlgorithmProvider
public class SpeedManagerAlgorithmProviderV1
extends Object
implements SpeedManagerAlgorithmProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SpeedManagerAlgorithmProviderAdapterprivate static booleanprivate static floatprivate final Averageprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final String[]private static final intprivate intprivate static final intprivate static final intprivate static intprivate static final intprivate intprivate booleanprivate intprivate static final intprivate static final intprivate static final intprivate static intprivate static intprivate static intprivate intprivate static intprivate intprivate static final intprivate static intprivate intprivate static final intprivate static final intprivate static final intprivate intprivate final Averageprivate static final intprivate static intprivate Mapprivate intprivate longprivate intprivate static final intprivate final Averageprivate final Averageprivate final AverageFields inherited from interface SpeedManagerAlgorithmProvider
UPDATE_PERIOD_MILLIS -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidcalculate(SpeedManagerPingSource[] sources) Called whenever a new set of ping values is available for processingvoiddestroy()booleanIndicates whether or not the provider is adjusting download as well as upload limitslongReturns the current view of when choking occursintintVarious getters for interesting info shown in stats viewintlongprotected voidvoidPing source has failedvoidpingSourceFound(SpeedManagerPingSource source, boolean is_replacement) Called when a new source of ping times has been foundvoidreset()Reset any state to start of day valuesvoidCalled periodically (see period above) to allow stats to be updated.
-
Field Details
-
CONFIG_MIN_UP
- See Also:
-
CONFIG_MAX_UP
- See Also:
-
CONFIG_MAX_INC
- See Also:
-
CONFIG_MAX_DEC
- See Also:
-
CONFIG_CHOKE_PING
- See Also:
-
CONFIG_DOWNADJ_ENABLE
- See Also:
-
CONFIG_DOWNADJ_RATIO
- See Also:
-
CONFIG_LATENCY_FACTOR
- See Also:
-
CONFIG_FORCED_MIN
- See Also:
-
PING_CHOKE_TIME
private static int PING_CHOKE_TIME -
MIN_UP
private static int MIN_UP -
MAX_UP
private static int MAX_UP -
ADJUST_DOWNLOAD_ENABLE
private static boolean ADJUST_DOWNLOAD_ENABLE -
ADJUST_DOWNLOAD_RATIO
private static float ADJUST_DOWNLOAD_RATIO -
MAX_INCREMENT
private static int MAX_INCREMENT -
MAX_DECREMENT
private static int MAX_DECREMENT -
LATENCY_FACTOR
private static int LATENCY_FACTOR -
FORCED_MIN_SPEED
private static int FORCED_MIN_SPEED -
CONFIG_PARAMS
-
UNLIMITED
private static final int UNLIMITED- See Also:
-
MODE_RUNNING
private static final int MODE_RUNNING- See Also:
-
MODE_FORCED_MIN
private static final int MODE_FORCED_MIN- See Also:
-
MODE_FORCED_MAX
private static final int MODE_FORCED_MAX- See Also:
-
FORCED_MAX_TICKS
private static final int FORCED_MAX_TICKS- See Also:
-
FORCED_MIN_TICKS
private static final int FORCED_MIN_TICKS- See Also:
-
FORCED_MIN_AT_START_TICK_LIMIT
private static final int FORCED_MIN_AT_START_TICK_LIMIT- See Also:
-
PING_AVERAGE_HISTORY_COUNT
private static final int PING_AVERAGE_HISTORY_COUNT- See Also:
-
IDLE_UPLOAD_SPEED
private static final int IDLE_UPLOAD_SPEED- See Also:
-
INITIAL_IDLE_AVERAGE
private static final int INITIAL_IDLE_AVERAGE- See Also:
-
MIN_IDLE_AVERAGE
private static final int MIN_IDLE_AVERAGE- See Also:
-
INCREASING
private static final int INCREASING- See Also:
-
DECREASING
private static final int DECREASING- See Also:
-
adapter
-
upload_average
-
upload_short_average
-
upload_short_prot_average
-
ping_average_history
-
choke_speed_average
-
ping_sources
-
replacement_contacts
private volatile int replacement_contacts -
mode
private int mode -
mode_ticks
private volatile int mode_ticks -
saved_limit
private long saved_limit -
direction
private int direction -
ticks
private int ticks -
idle_ticks
private int idle_ticks -
idle_average
private int idle_average -
idle_average_set
private boolean idle_average_set -
max_ping
private int max_ping -
max_upload_average
private int max_upload_average
-
-
Constructor Details
-
SpeedManagerAlgorithmProviderV1
-
-
Method Details
-
destroy
public void destroy()- Specified by:
destroyin interfaceSpeedManagerAlgorithmProvider
-
updateStats
public void updateStats()Description copied from interface:SpeedManagerAlgorithmProviderCalled periodically (see period above) to allow stats to be updated.- Specified by:
updateStatsin interfaceSpeedManagerAlgorithmProvider
-
reset
public void reset()Description copied from interface:SpeedManagerAlgorithmProviderReset any state to start of day values- Specified by:
resetin interfaceSpeedManagerAlgorithmProvider
-
pingSourceFound
Description copied from interface:SpeedManagerAlgorithmProviderCalled when a new source of ping times has been found- Specified by:
pingSourceFoundin interfaceSpeedManagerAlgorithmProvider- Parameters:
source-is_replacement- One of the initial sources or a replacement for a failed one
-
pingSourceFailed
Description copied from interface:SpeedManagerAlgorithmProviderPing source has failed- Specified by:
pingSourceFailedin interfaceSpeedManagerAlgorithmProvider- Parameters:
source-
-
calculate
Description copied from interface:SpeedManagerAlgorithmProviderCalled whenever a new set of ping values is available for processing- Specified by:
calculatein interfaceSpeedManagerAlgorithmProvider- Parameters:
sources-
-
getIdlePingMillis
public int getIdlePingMillis()Description copied from interface:SpeedManagerAlgorithmProviderVarious getters for interesting info shown in stats view- Specified by:
getIdlePingMillisin interfaceSpeedManagerAlgorithmProvider- Returns:
-
getCurrentPingMillis
public int getCurrentPingMillis()- Specified by:
getCurrentPingMillisin interfaceSpeedManagerAlgorithmProvider
-
getMaxPingMillis
public int getMaxPingMillis()- Specified by:
getMaxPingMillisin interfaceSpeedManagerAlgorithmProvider
-
getCurrentChokeSpeed
public long getCurrentChokeSpeed()Returns the current view of when choking occurs- Specified by:
getCurrentChokeSpeedin interfaceSpeedManagerAlgorithmProvider- Returns:
- speed in bytes/sec
-
getMaxUploadSpeed
public long getMaxUploadSpeed()- Specified by:
getMaxUploadSpeedin interfaceSpeedManagerAlgorithmProvider
-
getAdjustsDownloadLimits
public boolean getAdjustsDownloadLimits()Description copied from interface:SpeedManagerAlgorithmProviderIndicates whether or not the provider is adjusting download as well as upload limits- Specified by:
getAdjustsDownloadLimitsin interfaceSpeedManagerAlgorithmProvider- Returns:
-
log
-