public class FIFOBandwidthLimiter extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
FIFOBandwidthLimiter.CompleteListener
Listener for bandwidth request completion events.
|
static interface |
FIFOBandwidthLimiter.Request
A bandwidth request, either inbound or outbound.
|
| Constructor and Description |
|---|
FIFOBandwidthLimiter(RouterContext context) |
| Modifier and Type | Method and Description |
|---|---|
int |
getCurrentParticipatingBandwidth()
Out bandwidth.
|
int |
getInboundBurstBytes() |
int |
getInboundBurstKBytesPerSecond()
The configured maximum, not the current rate.
|
int |
getInboundKBytesPerSecond()
The configured maximum, not the current rate.
|
int |
getMaxShareBandwidth()
In Bytes per second
|
int |
getOutboundBurstBytes() |
int |
getOutboundBurstKBytesPerSecond()
The configured maximum, not the current rate.
|
int |
getOutboundKBytesPerSecond()
The configured maximum, not the current rate.
|
float |
getReceiveBps() |
float |
getReceiveBps15s() |
float |
getSendBps() |
float |
getSendBps15s() |
(package private) StringBuilder |
getStatus() |
long |
getTotalAllocatedInboundBytes() |
long |
getTotalAllocatedOutboundBytes() |
long |
now() |
(package private) void |
refillBandwidthQueues(List<FIFOBandwidthLimiter.Request> buf,
long bytesInbound,
long bytesOutbound,
long maxBurstIn,
long maxBurstOut)
More bytes are available - add them to the queue and satisfy any requests
we can
|
void |
reinitialize() |
FIFOBandwidthLimiter.Request |
requestInbound(int bytesIn,
String purpose)
Request some bytes.
|
FIFOBandwidthLimiter.Request |
requestOutbound(int bytesOut,
int priority,
String purpose)
Request some bytes.
|
boolean |
sentParticipatingMessage(int size,
float factor)
We intend to send traffic for a participating tunnel
with the given size and adjustment factor.
|
(package private) void |
setInboundBurstBytes(int bytes) |
(package private) void |
setInboundBurstKBps(int kbytesPerSecond) |
(package private) void |
setOutboundBurstBytes(int bytes) |
(package private) void |
setOutboundBurstKBps(int kbytesPerSecond) |
void |
shutdown() |
public FIFOBandwidthLimiter(RouterContext context)
public int getCurrentParticipatingBandwidth()
public int getInboundBurstBytes()
public int getInboundBurstKBytesPerSecond()
public int getInboundKBytesPerSecond()
public int getMaxShareBandwidth()
public int getOutboundBurstBytes()
public int getOutboundBurstKBytesPerSecond()
public int getOutboundKBytesPerSecond()
public float getReceiveBps()
public float getReceiveBps15s()
public float getSendBps()
public float getSendBps15s()
StringBuilder getStatus()
public long getTotalAllocatedInboundBytes()
public long getTotalAllocatedOutboundBytes()
public long now()
final void refillBandwidthQueues(List<FIFOBandwidthLimiter.Request> buf, long bytesInbound, long bytesOutbound, long maxBurstIn, long maxBurstOut)
buf - contains satisfied outbound requests, really just to avoid object thrash, not really usedmaxBurstIn - allow up to this many bytes in from the burst section for this time period (may be negative)maxBurstOut - allow up to this many bytes in from the burst section for this time period (may be negative)public void reinitialize()
public FIFOBandwidthLimiter.Request requestInbound(int bytesIn, String purpose)
public FIFOBandwidthLimiter.Request requestOutbound(int bytesOut, int priority, String purpose)
public boolean sentParticipatingMessage(int size,
float factor)
size - bytesfactor - multiplier of size for the drop calculation, 1 for no adjustmentvoid setInboundBurstBytes(int bytes)
void setInboundBurstKBps(int kbytesPerSecond)
void setOutboundBurstBytes(int bytes)
void setOutboundBurstKBps(int kbytesPerSecond)
public void shutdown()