java.lang.Object
net.i2p.router.Tuner.BaseParam
net.i2p.router.Tuner.I2PTunnelServerIOStallTimeoutParam
All Implemented Interfaces:
Tuner.TunableParam
Enclosing class:
Tuner

private class Tuner.I2PTunnelServerIOStallTimeoutParamextends Tuner.BaseParam
Tunes the timeout after which a stalled I2PTunnel server connection is closed.
  • Field Details

    • _prevStallCount

      private long _prevStallCount
      Stall count at the last check, to spot new stalls.
  • Constructor Details

    • I2PTunnelServerIOStallTimeoutParam

      I2PTunnelServerIOStallTimeoutParam()
      Creates the parameter that tunes the I2PTunnel I/O stall timeout in ms.
  • Method Details

    • applyValue

      protected void applyValue(int value)
      Description copied from class: Tuner.BaseParam
      Apply the tunable value to the router configuration.
      Specified by:
      applyValue in class Tuner.BaseParam
      Parameters:
      value - the tunable value to apply to router configuration
    • getRuntimeValue

      protected int getRuntimeValue()
      Description copied from class: Tuner.BaseParam
      Current runtime value read from the router configuration.
      Specified by:
      getRuntimeValue in class Tuner.BaseParam
      Returns:
      current runtime value read from router config
    • getObservedStat

      protected double getObservedStat(RouterContext ctx)
      Observe the delta stall events since last tuning cycle. A monotonically increasing counter; we return the per-cycle delta so the Tuner sees a rate, not an accumulator.
      Specified by:
      getObservedStat in class Tuner.BaseParam
      Parameters:
      ctx - router context, never null
      Returns:
      observed stat value for autotuning
    • computeTarget

      protected int computeTarget(double observed)
      Adjust timeout based on stall rate: - High stall rate (>2 per cycle): the timeout is too tight, loosen it - Zero stalls: timeout may be too conservative, tighten slightly - Low stall rate (1 per cycle): no change.
      Specified by:
      computeTarget in class Tuner.BaseParam
      Parameters:
      observed - current stat value
      Returns:
      target tunable value