Class TrafficShapingOptions

    • Field Detail

      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
    • Constructor Detail

      • TrafficShapingOptions

        public TrafficShapingOptions()
      • TrafficShapingOptions

        public TrafficShapingOptions​(JsonObject json)
    • Method Detail

      • 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