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 SpeedManagerAlgorithmProviderAdapter
private static boolean
private static float
private final Average
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String[]
private static final int
private int
private static final int
private static final int
private static int
private static final int
private int
private boolean
private int
private static final int
private static final int
private static final int
private static int
private static int
private static int
private int
private static int
private int
private static final int
private static int
private int
private static final int
private static final int
private static final int
private int
private final Average
private static final int
private static int
private Map
private int
private int
private int
private static final int
private final Average
private final Average
private final Average
Fields inherited from interface com.biglybt.core.speedmanager.impl.SpeedManagerAlgorithmProvider
UPDATE_PERIOD_MILLIS
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoid
calculate
(SpeedManagerPingSource[] sources) Called whenever a new set of ping values is available for processingvoid
destroy()
boolean
Indicates whether or not the provider is adjusting download as well as upload limitsint
Returns the current view of when choking occursint
int
Various getters for interesting info shown in stats viewint
int
protected void
void
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
Called 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 int 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:
destroy
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
-
reset
public void reset()Description copied from interface:SpeedManagerAlgorithmProvider
Reset any state to start of day values- Specified by:
reset
in interfaceSpeedManagerAlgorithmProvider
-
pingSourceFound
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
Description copied from interface:SpeedManagerAlgorithmProvider
Ping source has failed- Specified by:
pingSourceFailed
in interfaceSpeedManagerAlgorithmProvider
-
calculate
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()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
-