Package net.i2p.router.transport
Class FIFOBandwidthRefiller
java.lang.Object
net.i2p.router.transport.FIFOBandwidthRefiller
- All Implemented Interfaces:
Runnable
Thread that runs several times a second to "give" bandwidth to
FIFOBandwidthLimiter.
Instantiated by FIFOBandwidthLimiter.
As of 0.8.12, this also contains a counter for outbound participating bandwidth.
This was a good place for it since we needed a thread for it.
Public only for the properties and defaults.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
Caution, do not make DEFAULT_OUTBOUND_BANDWIDTH * DEFAULT_SHARE_PCT > 32 without thinking about the implications (default connection limits, for example) of moving the default bandwidth class from L to M, or maybe adjusting bandwidth class boundaries.static final int
static final int
Max for reasonable Bloom filter false positive rate.static final int
For now, until there is some tuning and safe throttling, we set the floor at this inbound (KBps)static final int
For now, until there is some tuning and safe throttling, we set the floor at this during burst (KBps)static final int
For now, until there is some tuning and safe throttling, we set the floor at this outbound (KBps)static final int
For now, until there is some tuning and safe throttling, we set the floor at this during burst (KBps)static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) int
Out bandwidth.(package private) int
(package private) int
(package private) int
(package private) int
(package private) boolean
incrementParticipatingMessageBytes
(int size, float factor) We intend to send traffic for a participating tunnel with the given size and adjustment factor.(package private) void
void
run()
(package private) void
shutdown()
-
Field Details
-
PROP_INBOUND_BANDWIDTH
- See Also:
-
PROP_OUTBOUND_BANDWIDTH
- See Also:
-
PROP_INBOUND_BURST_BANDWIDTH
- See Also:
-
PROP_OUTBOUND_BURST_BANDWIDTH
- See Also:
-
PROP_INBOUND_BANDWIDTH_PEAK
- See Also:
-
PROP_OUTBOUND_BANDWIDTH_PEAK
- See Also:
-
DEFAULT_INBOUND_BANDWIDTH
public static final int DEFAULT_INBOUND_BANDWIDTH- See Also:
-
DEFAULT_OUTBOUND_BANDWIDTH
public static final int DEFAULT_OUTBOUND_BANDWIDTHCaution, do not make DEFAULT_OUTBOUND_BANDWIDTH * DEFAULT_SHARE_PCT > 32 without thinking about the implications (default connection limits, for example) of moving the default bandwidth class from L to M, or maybe adjusting bandwidth class boundaries.- See Also:
-
DEFAULT_INBOUND_BURST_BANDWIDTH
public static final int DEFAULT_INBOUND_BURST_BANDWIDTH- See Also:
-
DEFAULT_OUTBOUND_BURST_BANDWIDTH
public static final int DEFAULT_OUTBOUND_BURST_BANDWIDTH- See Also:
-
DEFAULT_BURST_SECONDS
public static final int DEFAULT_BURST_SECONDS- See Also:
-
MIN_INBOUND_BANDWIDTH
public static final int MIN_INBOUND_BANDWIDTHFor now, until there is some tuning and safe throttling, we set the floor at this inbound (KBps)- See Also:
-
MIN_OUTBOUND_BANDWIDTH
public static final int MIN_OUTBOUND_BANDWIDTHFor now, until there is some tuning and safe throttling, we set the floor at this outbound (KBps)- See Also:
-
MIN_INBOUND_BANDWIDTH_PEAK
public static final int MIN_INBOUND_BANDWIDTH_PEAKFor now, until there is some tuning and safe throttling, we set the floor at this during burst (KBps)- See Also:
-
MIN_OUTBOUND_BANDWIDTH_PEAK
public static final int MIN_OUTBOUND_BANDWIDTH_PEAKFor now, until there is some tuning and safe throttling, we set the floor at this during burst (KBps)- See Also:
-
MAX_OUTBOUND_BANDWIDTH
public static final int MAX_OUTBOUND_BANDWIDTHMax for reasonable Bloom filter false positive rate. Do not increase without adding a new Bloom filter size! See util/DecayingBloomFilter and tunnel/BloomFilterIVValidator.- See Also:
-
-
Constructor Details
-
FIFOBandwidthRefiller
FIFOBandwidthRefiller(RouterContext context, FIFOBandwidthLimiter limiter)
-
-
Method Details
-
shutdown
void shutdown()- Since:
- 0.8.8
-
run
public void run() -
reinitialize
void reinitialize() -
getOutboundKBytesPerSecond
int getOutboundKBytesPerSecond() -
getInboundKBytesPerSecond
int getInboundKBytesPerSecond() -
getOutboundBurstKBytesPerSecond
int getOutboundBurstKBytesPerSecond() -
getInboundBurstKBytesPerSecond
int getInboundBurstKBytesPerSecond() -
incrementParticipatingMessageBytes
boolean incrementParticipatingMessageBytes(int size, float factor) We intend to send traffic for a participating tunnel with the given size and adjustment factor. Returns true if the message can be sent within the current share bandwidth limits, or false if it should be dropped.- Parameters:
size
- bytesfactor
- multiplier of size for the drop calculation, 1 for no adjustment- Returns:
- true for accepted, false for drop
- Since:
- 0.8.12
-
getCurrentParticipatingBandwidth
int getCurrentParticipatingBandwidth()Out bandwidth. Actual bandwidth, not smoothed, not bucketed.- Returns:
- Bps in recent period (a few seconds)
- Since:
- 0.8.12
-