net.i2p.router.transport
Class BandwidthLimiterTest

java.lang.Object
  extended bynet.i2p.router.transport.BandwidthLimiterTest

public class BandwidthLimiterTest
extends java.lang.Object

Stress out the bandwidth limiter by running a series of push and pull tests through bandwidth limited streams. This includes pushing data through unthrottled streams, through streams throttled at 4KBps, 32KBps, and 256KBps, pulling data through those same rates, as well as doing so with 10 concurrent threads (and, in turn, 10 concurrent streams all using the same BandwidthLimiter). Note: this takes a long time to run (~1 hour) since the 4KBps push/pull of 1MB with 10 concurrent threads is, well, slow.


Constructor Summary
BandwidthLimiterTest()
           
 
Method Summary
static void main(java.lang.String[] args)
           
 void prepareLimiter(int inKBps, int outKBps, int inBurst, int outBurst)
           
 void testInbound()
          Run a series of tests on inbound throttling (pulling lots of data through pipes with various limits) and log the times.
 long testInboundThrottle(int numBytes, int numBytesPerRead)
          Using the configured limiter, determine how long it takes to read numBytes through a BandwidthLimitedInputStream (broken up into numBytesPerRead) chunks.
 void testOutbound()
          Run a series of tests on outbound throttling (shoving lots of data through pipes with various limits) and log the times.
 void testOutboundContention()
           
 long testOutboundThrottle(int numBytes, int numBytesPerWrite)
          Using the configured limiter, determine how long it takes to shove numBytes through a BandwidthLimitedOutputStream (broken up into numBytesPerWrite) chunks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BandwidthLimiterTest

public BandwidthLimiterTest()
Method Detail

prepareLimiter

public void prepareLimiter(int inKBps,
                           int outKBps,
                           int inBurst,
                           int outBurst)

testOutboundThrottle

public long testOutboundThrottle(int numBytes,
                                 int numBytesPerWrite)
Using the configured limiter, determine how long it takes to shove numBytes through a BandwidthLimitedOutputStream (broken up into numBytesPerWrite) chunks.


testInboundThrottle

public long testInboundThrottle(int numBytes,
                                int numBytesPerRead)
Using the configured limiter, determine how long it takes to read numBytes through a BandwidthLimitedInputStream (broken up into numBytesPerRead) chunks.


testOutbound

public void testOutbound()
Run a series of tests on outbound throttling (shoving lots of data through pipes with various limits) and log the times.


testInbound

public void testInbound()
Run a series of tests on inbound throttling (pulling lots of data through pipes with various limits) and log the times.


testOutboundContention

public void testOutboundContention()

main

public static void main(java.lang.String[] args)