Class TrafficShapingOptions

java.lang.Object
io.vertx.core.net.TrafficShapingOptions

public class TrafficShapingOptions extends Object
Options describing how GlobalTrafficShapingHandler will handle traffic shaping.
  • Field Details

    • DEFAULT_INBOUND_GLOBAL_BANDWIDTH_LIMIT

      public static final long DEFAULT_INBOUND_GLOBAL_BANDWIDTH_LIMIT
      Default 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_LIMIT
      Default 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_BANDWIDTH
      Default peak outbound bandwidth limit in bytes/sec = 400 Mbps (aligns with netty's default in io.netty.handler.traffic.AbstractTrafficShapingHandler#DEFAULT_MAX_SIZE)
      See Also:
    • DEFAULT_CHECK_INTERVAL

      public static final long DEFAULT_CHECK_INTERVAL
      Default check interval for stats = 1 second. The units are in milliseconds. (Aligns with netty's default in AbstractTrafficShapingHandler.DEFAULT_CHECK_INTERVAL)
    • DEFAULT_MAX_TIME

      public static final long DEFAULT_MAX_TIME
      Default max delay to wait = 15 seconds. The units are in milliseconds. (Aligns with netty's default in AbstractTrafficShapingHandler.DEFAULT_MAX_TIME)
  • Constructor Details

    • TrafficShapingOptions

      public TrafficShapingOptions()
    • TrafficShapingOptions

      public TrafficShapingOptions(TrafficShapingOptions other)
    • TrafficShapingOptions

      public TrafficShapingOptions(JsonObject json)
  • Method Details

    • toJson

      public JsonObject toJson()
    • setInboundGlobalBandwidth

      public TrafficShapingOptions setInboundGlobalBandwidth(long inboundGlobalBandwidth)
      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

      public TrafficShapingOptions setOutboundGlobalBandwidth(long outboundGlobalBandwidth)
      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

      public TrafficShapingOptions setMaxDelayToWait(long maxDelayToWaitTime)
      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

      public TrafficShapingOptions setMaxDelayToWaitUnit(TimeUnit maxDelayToWaitTimeUnit)
      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

      public TrafficShapingOptions setCheckIntervalForStats(long checkIntervalForStats)
      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

      public TrafficShapingOptions setPeakOutboundGlobalBandwidth(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. 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

      public TimeUnit getMaxDelayToWaitTimeUnit()
      Returns:
      maximum delay time unit
    • getCheckIntervalForStats

      public long getCheckIntervalForStats()
      Returns:
      delay between two computations of performances
    • getCheckIntervalForStatsTimeUnit

      public TimeUnit getCheckIntervalForStatsTimeUnit()
      Returns:
      check interval for stats time unit
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object