com.aelitis.azureus.core.speedmanager.impl.v2
Class PingSpaceMapper

java.lang.Object
  extended by com.aelitis.azureus.core.speedmanager.impl.v2.PingSpaceMapper

public class PingSpaceMapper
extends Object

Classifies the ping-times and then maps them against the a grid of upload and download rates. Create a two dimensional map of upload and download rates. Map onto this space ping times. The mesh size will be smaller near zero, and larger higher up. 0 - 100 kByte/sec - 10 kBytes mesh size. 100 - 500 kBytes/sec - 50 kBytes mesh size. 500 - 5000 kBytes/sec - 100 kBytes mesh size. Anything above 5 MBytes/sec is one region.


Field Summary
static int RESULT_DOWNLOAD_INDEX
           
static int RESULT_UPLOAD_INDEX
           
 
Constructor Summary
PingSpaceMapper(int _goodPingInMilliSec, int _badPingInMilliSec)
          Create a grid and define good and bad ping times.
 
Method Summary
 void addMetricToMap(int metric)
           
 int guessDownloadLimit()
          Make a guess at the download capacity based on metric data.
 int guessUploadLimit()
          Make a guess at the upload capacity based on metric data.
 boolean hadChockingPing(boolean isDownloadTest)
          Try to determine if a chocking ping occured during this test.
 void reset()
          Start accumlating data from scratch.
 void setCurrentTransferRates(int downloadBitPerSec, int uploadBitsPerSec)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESULT_UPLOAD_INDEX

public static final int RESULT_UPLOAD_INDEX
See Also:
Constant Field Values

RESULT_DOWNLOAD_INDEX

public static final int RESULT_DOWNLOAD_INDEX
See Also:
Constant Field Values
Constructor Detail

PingSpaceMapper

public PingSpaceMapper(int _goodPingInMilliSec,
                       int _badPingInMilliSec)
Create a grid and define good and bad ping times.

Parameters:
_goodPingInMilliSec - -
_badPingInMilliSec - -
Method Detail

setCurrentTransferRates

public void setCurrentTransferRates(int downloadBitPerSec,
                                    int uploadBitsPerSec)

addMetricToMap

public void addMetricToMap(int metric)

reset

public void reset()
Start accumlating data from scratch.


hadChockingPing

public boolean hadChockingPing(boolean isDownloadTest)
Try to determine if a chocking ping occured during this test.

Parameters:
isDownloadTest - - set true if this is a download_search_test. set false if upload search test.
Returns:
- true if it appears a chocking ping occured.

guessUploadLimit

public int guessUploadLimit()
Make a guess at the upload capacity based on metric data.

Returns:
-

guessDownloadLimit

public int guessDownloadLimit()
Make a guess at the download capacity based on metric data.

Returns:
-