Class SpeedManagerImpl
java.lang.Object
com.biglybt.core.speedmanager.impl.SpeedManagerImpl
- All Implemented Interfaces:
SpeedManagerAlgorithmProviderAdapter, SpeedManager, AEDiagnosticsEvidenceGenerator
public class SpeedManagerImpl
extends Object
implements SpeedManager, SpeedManagerAlgorithmProviderAdapter, AEDiagnosticsEvidenceGenerator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final SpeedManagerAdapterprivate Stringprivate static final intprivate static final intprivate static final Stringprivate static final Stringprivate static final String[]static final Stringstatic final Stringprivate static final intprivate static final int(package private) final Mapprivate SpeedManagerImpl.pingContact[](package private) final Coreprivate static boolean(package private) final AsyncDispatcherprivate static booleanprivate booleanprivate final CopyOnWriteListprivate final AEDiagnosticsLoggerprivate static final intprivate static final int(package private) static final intprivate static final intprivate Object(package private) final SpeedManagerPingMapperImpl(package private) final SpeedManagerPingMapperImpl[]private static final booleanprivate SpeedManagerAlgorithmProviderprivate intprivate static final intprivate static final int(package private) static final intprivate static final intprivate static final intprivate DHTSpeedTesterprivate intprivate final CopyOnWriteListprotected static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidaddPingHistory(int rtt, boolean re_base) private voidCreates a mapper starting from current time.protected voiddestroy(SpeedManagerPingMapper mapper) protected voidvoidgenerate(IndentWriter writer) getASN()longReturns the current view of when choking occurslonglonglongintlonglonglongintintlongprotected voidprotected voidinformListeners(int type) protected voidbooleanbooleanvoidvoidvoidreset()voidsetCurrentDownloadLimit(long bytes_per_second) voidsetCurrentUploadLimit(long bytes_per_second) voidsetEnabled(boolean _enabled) protected voidsetEnabledSupport(boolean _enabled) voidsetEstimatedDownloadCapacityBytesPerSec(long bytes_per_sec, float metric) voidsetEstimatedUploadCapacityBytesPerSec(long bytes_per_sec, float metric) voidsetLoggingEnabled(boolean enabled) voidsetSpeedTester(DHTSpeedTester _tester)
-
Field Details
-
UPDATE_PERIOD_MILLIS
protected static final int UPDATE_PERIOD_MILLIS- See Also:
-
CONTACT_NUMBER
private static final int CONTACT_NUMBER- See Also:
-
CONTACT_PING_SECS
private static final int CONTACT_PING_SECS- See Also:
-
LONG_PERIOD_SECS
private static final int LONG_PERIOD_SECS- See Also:
-
LONG_PERIOD_TICKS
private static final int LONG_PERIOD_TICKS- See Also:
-
SHORT_ESTIMATE_SECS
private static final int SHORT_ESTIMATE_SECS- See Also:
-
MEDIUM_ESTIMATE_SECS
private static final int MEDIUM_ESTIMATE_SECS- See Also:
-
SHORT_ESTIMATE_SAMPLES
static final int SHORT_ESTIMATE_SAMPLES- See Also:
-
MEDIUM_ESTIMATE_SAMPLES
static final int MEDIUM_ESTIMATE_SAMPLES- See Also:
-
SAVE_PERIOD_SECS
private static final int SAVE_PERIOD_SECS- See Also:
-
SAVE_PERIOD_TICKS
private static final int SAVE_PERIOD_TICKS- See Also:
-
AUTO_ADJUST_PERIOD_SECS
private static final int AUTO_ADJUST_PERIOD_SECS- See Also:
-
AUTO_ADJUST_PERIOD_TICKS
private static final int AUTO_ADJUST_PERIOD_TICKS- See Also:
-
SPEED_AVERAGE_PERIOD
private static final int SPEED_AVERAGE_PERIOD- See Also:
-
DEBUG
private static boolean DEBUG -
CONFIG_VERSION_STR
- See Also:
-
CONFIG_VERSION
- See Also:
-
CONFIG_AVAIL
- See Also:
-
CONFIG_DEBUG
- See Also:
-
CONFIG_PARAMS
-
emulated_ping_source
private static boolean emulated_ping_source -
core
-
speed_tester
-
adapter
-
provider
-
provider_version
private int provider_version -
enabled
private boolean enabled -
pm_enabled
private static final boolean pm_enabled- See Also:
-
contacts
-
total_contacts
private volatile int total_contacts -
contacts_array
-
original_limits
-
dispatcher
-
ping_mapper
-
ping_mappers
-
transient_mappers
-
logger
-
asn
-
listeners
-
-
Constructor Details
-
SpeedManagerImpl
-
-
Method Details
-
getSpeedManager
- Specified by:
getSpeedManagerin interfaceSpeedManagerAlgorithmProviderAdapter
-
getASN
- Specified by:
getASNin interfaceSpeedManager
-
getEstimatedUploadCapacityBytesPerSec
- Specified by:
getEstimatedUploadCapacityBytesPerSecin interfaceSpeedManager
-
setEstimatedUploadCapacityBytesPerSec
public void setEstimatedUploadCapacityBytesPerSec(long bytes_per_sec, float metric) - Specified by:
setEstimatedUploadCapacityBytesPerSecin interfaceSpeedManager- Parameters:
bytes_per_sec-
-
getEstimatedDownloadCapacityBytesPerSec
- Specified by:
getEstimatedDownloadCapacityBytesPerSecin interfaceSpeedManager
-
setEstimatedDownloadCapacityBytesPerSec
public void setEstimatedDownloadCapacityBytesPerSec(long bytes_per_sec, float metric) - Specified by:
setEstimatedDownloadCapacityBytesPerSecin interfaceSpeedManager
-
reset
public void reset()- Specified by:
resetin interfaceSpeedManager
-
enableOrAlgChanged
protected void enableOrAlgChanged() -
createTransientPingMapper
Description copied from interface:SpeedManagerAlgorithmProviderAdapterCreates a mapper starting from current time. Must be destroyed by calling "destroy" when done with- Specified by:
createTransientPingMapperin interfaceSpeedManagerAlgorithmProviderAdapter- Returns:
-
destroy
-
setSpeedTester
- Specified by:
setSpeedTesterin interfaceSpeedManager
-
addPingHistory
protected void addPingHistory(int rtt, boolean re_base) -
isAvailable
public boolean isAvailable()- Specified by:
isAvailablein interfaceSpeedManager
-
setEnabled
public void setEnabled(boolean _enabled) - Specified by:
setEnabledin interfaceSpeedManager
-
setEnabledSupport
protected void setEnabledSupport(boolean _enabled) -
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceSpeedManager
-
getSpeedTester
- Specified by:
getSpeedTesterin interfaceSpeedManager
-
getPingSources
- Specified by:
getPingSourcesin interfaceSpeedManager
-
getActiveMapper
- Specified by:
getActiveMapperin interfaceSpeedManager
-
getPingMapper
- Specified by:
getPingMapperin interfaceSpeedManagerAlgorithmProviderAdapter
-
getMappers
- Specified by:
getMappersin interfaceSpeedManager
-
getIdlePingMillis
public int getIdlePingMillis() -
getCurrentPingMillis
public int getCurrentPingMillis() -
getMaxPingMillis
public int getMaxPingMillis() -
getCurrentChokeSpeed
public long getCurrentChokeSpeed()Returns the current view of when choking occurs- Returns:
- speed in bytes/sec
-
getMaxUploadSpeed
public long getMaxUploadSpeed() -
getCurrentUploadLimit
public long getCurrentUploadLimit()- Specified by:
getCurrentUploadLimitin interfaceSpeedManagerAlgorithmProviderAdapter
-
setCurrentUploadLimit
public void setCurrentUploadLimit(long bytes_per_second) - Specified by:
setCurrentUploadLimitin interfaceSpeedManagerAlgorithmProviderAdapter
-
getCurrentDownloadLimit
public long getCurrentDownloadLimit()- Specified by:
getCurrentDownloadLimitin interfaceSpeedManagerAlgorithmProviderAdapter
-
setCurrentDownloadLimit
public void setCurrentDownloadLimit(long bytes_per_second) - Specified by:
setCurrentDownloadLimitin interfaceSpeedManagerAlgorithmProviderAdapter
-
getCurrentProtocolUploadSpeed
public long getCurrentProtocolUploadSpeed()- Specified by:
getCurrentProtocolUploadSpeedin interfaceSpeedManagerAlgorithmProviderAdapter
-
getCurrentDataUploadSpeed
public long getCurrentDataUploadSpeed()- Specified by:
getCurrentDataUploadSpeedin interfaceSpeedManagerAlgorithmProviderAdapter
-
getCurrentDataDownloadSpeed
public long getCurrentDataDownloadSpeed()- Specified by:
getCurrentDataDownloadSpeedin interfaceSpeedManagerAlgorithmProviderAdapter
-
getCurrentProtocolDownloadSpeed
public long getCurrentProtocolDownloadSpeed()- Specified by:
getCurrentProtocolDownloadSpeedin interfaceSpeedManagerAlgorithmProviderAdapter
-
autoAdjust
private void autoAdjust() -
setLoggingEnabled
public void setLoggingEnabled(boolean enabled) -
log
- Specified by:
login interfaceSpeedManagerAlgorithmProviderAdapter
-
informDownCapChanged
protected void informDownCapChanged() -
informUpCapChanged
protected void informUpCapChanged() -
informListeners
protected void informListeners(int type) -
addListener
- Specified by:
addListenerin interfaceSpeedManager
-
removeListener
- Specified by:
removeListenerin interfaceSpeedManager
-
generate
- Specified by:
generatein interfaceAEDiagnosticsEvidenceGenerator
-