Class TrafficShapingOptions
java.lang.Object
io.vertx.core.net.TrafficShapingOptions
Options describing how
GlobalTrafficShapingHandler will handle traffic shaping.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longDefault check interval for stats = 1 second.static final longDefault inbound bandwidth limit in bytes/sec = 0 (0 implies unthrottled)static final longDefault max delay to wait = 15 seconds.static final longDefault outbound bandwidth limit in bytes/sec = 0 (0 implies unthrottled)static final longDefault peak outbound bandwidth limit in bytes/sec = 400 Mbps (aligns with netty's default inio.netty.handler.traffic.AbstractTrafficShapingHandler#DEFAULT_MAX_SIZE) -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionbooleanlonglonglonglonglonginthashCode()setCheckIntervalForStats(long checkIntervalForStats) Set the delay between two computations of performances for channelssetCheckIntervalForStatsTimeUnit(TimeUnit checkIntervalForStatsTimeUnit) Set time unit for check interval for stats.setInboundGlobalBandwidth(long inboundGlobalBandwidth) Set bandwidth limit in bytes per second for inbound connectionssetMaxDelayToWait(long maxDelayToWaitTime) Set the maximum delay to wait in case of traffic excesssetMaxDelayToWaitUnit(TimeUnit maxDelayToWaitTimeUnit) Set the maximum delay to wait time unitsetOutboundGlobalBandwidth(long outboundGlobalBandwidth) Set bandwidth limit in bytes per second for outbound connectionssetPeakOutboundGlobalBandwidth(long peakOutboundGlobalBandwidth) Set the maximum global write size in bytes per second allowed in the buffer globally for all channels before write suspended is set.toJson()
-
Field Details
-
DEFAULT_INBOUND_GLOBAL_BANDWIDTH_LIMIT
public static final long DEFAULT_INBOUND_GLOBAL_BANDWIDTH_LIMITDefault inbound bandwidth limit in bytes/sec = 0 (0 implies unthrottled)- See Also:
-
DEFAULT_OUTBOUND_GLOBAL_BANDWIDTH_LIMIT
public static final long DEFAULT_OUTBOUND_GLOBAL_BANDWIDTH_LIMITDefault outbound bandwidth limit in bytes/sec = 0 (0 implies unthrottled)- See Also:
-
DEFAULT_PEAK_OUTBOUND_GLOBAL_BANDWIDTH
public static final long DEFAULT_PEAK_OUTBOUND_GLOBAL_BANDWIDTHDefault peak outbound bandwidth limit in bytes/sec = 400 Mbps (aligns with netty's default inio.netty.handler.traffic.AbstractTrafficShapingHandler#DEFAULT_MAX_SIZE)- See Also:
-
DEFAULT_CHECK_INTERVAL
public static final long DEFAULT_CHECK_INTERVALDefault check interval for stats = 1 second. The units are in milliseconds. (Aligns with netty's default inAbstractTrafficShapingHandler.DEFAULT_CHECK_INTERVAL) -
DEFAULT_MAX_TIME
public static final long DEFAULT_MAX_TIMEDefault max delay to wait = 15 seconds. The units are in milliseconds. (Aligns with netty's default inAbstractTrafficShapingHandler.DEFAULT_MAX_TIME)
-
-
Constructor Details
-
TrafficShapingOptions
public TrafficShapingOptions() -
TrafficShapingOptions
-
TrafficShapingOptions
-
-
Method Details
-
toJson
-
setInboundGlobalBandwidth
Set bandwidth limit in bytes per second for inbound connections- Parameters:
inboundGlobalBandwidth- bandwidth limit- Returns:
- a reference to this, so the API can be used fluently
-
setOutboundGlobalBandwidth
Set bandwidth limit in bytes per second for outbound connections- Parameters:
outboundGlobalBandwidth- bandwidth limit- Returns:
- a reference to this, so the API can be used fluently
-
setMaxDelayToWait
Set the maximum delay to wait in case of traffic excess- Parameters:
maxDelayToWaitTime- maximum delay time for waiting- Returns:
- a reference to this, so the API can be used fluently
-
setMaxDelayToWaitUnit
Set the maximum delay to wait time unit- Parameters:
maxDelayToWaitTimeUnit- maximum delay time's unit- Returns:
- a reference to this, so the API can be used fluently
-
setCheckIntervalForStats
Set the delay between two computations of performances for channels- Parameters:
checkIntervalForStats- delay between two computations of performances- Returns:
- a reference to this, so the API can be used fluently
-
setCheckIntervalForStatsTimeUnit
public TrafficShapingOptions setCheckIntervalForStatsTimeUnit(TimeUnit checkIntervalForStatsTimeUnit) Set time unit for check interval for stats.- Parameters:
checkIntervalForStatsTimeUnit- check interval for stats time unit- Returns:
- a reference to this, so the API can be used fluently
-
setPeakOutboundGlobalBandwidth
Set the maximum global write size in bytes per second allowed in the buffer globally for all channels before write suspended is set. Default value is 400 MB- Parameters:
peakOutboundGlobalBandwidth- peak outbound bandwidth- Returns:
- a reference to this, so the API can be used fluently
-
getInboundGlobalBandwidth
public long getInboundGlobalBandwidth()- Returns:
- inbound bandwidth limit in bytes
-
getOutboundGlobalBandwidth
public long getOutboundGlobalBandwidth()- Returns:
- outbound bandwidth limit in byte
-
getPeakOutboundGlobalBandwidth
public long getPeakOutboundGlobalBandwidth()- Returns:
- max outbound bandwidth limit in bytes
-
getMaxDelayToWait
public long getMaxDelayToWait()- Returns:
- maximum delay to wait in case of traffic excess
-
getMaxDelayToWaitTimeUnit
- Returns:
- maximum delay time unit
-
getCheckIntervalForStats
public long getCheckIntervalForStats()- Returns:
- delay between two computations of performances
-
getCheckIntervalForStatsTimeUnit
- Returns:
- check interval for stats time unit
-
equals
-
hashCode
-