Class EndpointCircuitBreaker.Builder

java.lang.Object
com.ngrok.definitions.EndpointCircuitBreaker.Builder
Enclosing class:
EndpointCircuitBreaker

public static class EndpointCircuitBreaker.Builder extends Object
Builder class for EndpointCircuitBreaker.
  • Method Details

    • enabled

      public EndpointCircuitBreaker.Builder enabled(boolean enabled)
      true if the module will be applied to traffic, false to disable. default true if unspecified
      Parameters:
      enabled - the value of the enabled parameter as a boolean
      Returns:
      this builder instance
    • enabled

      public EndpointCircuitBreaker.Builder enabled(Optional<Boolean> enabled)
      true if the module will be applied to traffic, false to disable. default true if unspecified
      Parameters:
      enabled - the value of the enabled parameter as a boolean, wrapped in an Optional
      Returns:
      this builder instance
    • trippedDuration

      public EndpointCircuitBreaker.Builder trippedDuration(Duration trippedDuration)
      Integer number of seconds after which the circuit is tripped to wait before re-evaluating upstream health
      Parameters:
      trippedDuration - the value of the tripped_duration parameter as a Duration
      Returns:
      this builder instance
    • trippedDuration

      public EndpointCircuitBreaker.Builder trippedDuration(Optional<Duration> trippedDuration)
      Integer number of seconds after which the circuit is tripped to wait before re-evaluating upstream health
      Parameters:
      trippedDuration - the value of the tripped_duration parameter as a Duration, wrapped in an Optional
      Returns:
      this builder instance
    • rollingWindow

      public EndpointCircuitBreaker.Builder rollingWindow(long rollingWindow)
      Integer number of seconds in the statistical rolling window that metrics are retained for.
      Parameters:
      rollingWindow - the value of the rolling_window parameter as a long
      Returns:
      this builder instance
    • rollingWindow

      public EndpointCircuitBreaker.Builder rollingWindow(Optional<Long> rollingWindow)
      Integer number of seconds in the statistical rolling window that metrics are retained for.
      Parameters:
      rollingWindow - the value of the rolling_window parameter as a long, wrapped in an Optional
      Returns:
      this builder instance
    • numBuckets

      public EndpointCircuitBreaker.Builder numBuckets(long numBuckets)
      Integer number of buckets into which metrics are retained. Max 128.
      Parameters:
      numBuckets - the value of the num_buckets parameter as a long
      Returns:
      this builder instance
    • numBuckets

      public EndpointCircuitBreaker.Builder numBuckets(Optional<Long> numBuckets)
      Integer number of buckets into which metrics are retained. Max 128.
      Parameters:
      numBuckets - the value of the num_buckets parameter as a long, wrapped in an Optional
      Returns:
      this builder instance
    • volumeThreshold

      public EndpointCircuitBreaker.Builder volumeThreshold(long volumeThreshold)
      Integer number of requests in a rolling window that will trip the circuit. Helpful if traffic volume is low.
      Parameters:
      volumeThreshold - the value of the volume_threshold parameter as a long
      Returns:
      this builder instance
    • volumeThreshold

      public EndpointCircuitBreaker.Builder volumeThreshold(Optional<Long> volumeThreshold)
      Integer number of requests in a rolling window that will trip the circuit. Helpful if traffic volume is low.
      Parameters:
      volumeThreshold - the value of the volume_threshold parameter as a long, wrapped in an Optional
      Returns:
      this builder instance
    • errorThresholdPercentage

      public EndpointCircuitBreaker.Builder errorThresholdPercentage(double errorThresholdPercentage)
      Error threshold percentage should be between 0 - 1.0, not 0-100.0
      Parameters:
      errorThresholdPercentage - the value of the error_threshold_percentage parameter as a double
      Returns:
      this builder instance
    • errorThresholdPercentage

      public EndpointCircuitBreaker.Builder errorThresholdPercentage(Optional<Double> errorThresholdPercentage)
      Error threshold percentage should be between 0 - 1.0, not 0-100.0
      Parameters:
      errorThresholdPercentage - the value of the error_threshold_percentage parameter as a double, wrapped in an Optional
      Returns:
      this builder instance
    • build

      public EndpointCircuitBreaker build()
      Constructs the EndpointCircuitBreaker instance.
      Returns:
      a new EndpointCircuitBreaker