Package com.ngrok.definitions
Class EndpointCircuitBreaker.Builder
java.lang.Object
com.ngrok.definitions.EndpointCircuitBreaker.Builder
- Enclosing class:
- EndpointCircuitBreaker
Builder class for
EndpointCircuitBreaker.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs theEndpointCircuitBreakerinstance.enabled(boolean enabled)trueif the module will be applied to traffic,falseto disable.trueif the module will be applied to traffic,falseto disable.errorThresholdPercentage(double errorThresholdPercentage)Error threshold percentage should be between 0 - 1.0, not 0-100.0errorThresholdPercentage(Optional<Double> errorThresholdPercentage)Error threshold percentage should be between 0 - 1.0, not 0-100.0numBuckets(long numBuckets)Integer number of buckets into which metrics are retained.numBuckets(Optional<Long> numBuckets)Integer number of buckets into which metrics are retained.rollingWindow(long rollingWindow)Integer number of seconds in the statistical rolling window that metrics are retained for.rollingWindow(Optional<Long> rollingWindow)Integer number of seconds in the statistical rolling window that metrics are retained for.trippedDuration(Duration trippedDuration)Integer number of seconds after which the circuit is tripped to wait before re-evaluating upstream healthtrippedDuration(Optional<Duration> trippedDuration)Integer number of seconds after which the circuit is tripped to wait before re-evaluating upstream healthvolumeThreshold(long volumeThreshold)Integer number of requests in a rolling window that will trip the circuit.volumeThreshold(Optional<Long> volumeThreshold)Integer number of requests in a rolling window that will trip the circuit.
-
Method Details
-
enabled
trueif the module will be applied to traffic,falseto disable. defaulttrueif unspecified- Parameters:
enabled- the value of theenabledparameter as aboolean- Returns:
- this builder instance
-
enabled
trueif the module will be applied to traffic,falseto disable. defaulttrueif unspecified- Parameters:
enabled- the value of theenabledparameter as aboolean, wrapped in anOptional- Returns:
- this builder instance
-
trippedDuration
Integer number of seconds after which the circuit is tripped to wait before re-evaluating upstream health- Parameters:
trippedDuration- the value of thetripped_durationparameter as aDuration- Returns:
- this builder instance
-
trippedDuration
Integer number of seconds after which the circuit is tripped to wait before re-evaluating upstream health -
rollingWindow
Integer number of seconds in the statistical rolling window that metrics are retained for.- Parameters:
rollingWindow- the value of therolling_windowparameter as along- Returns:
- this builder instance
-
rollingWindow
Integer number of seconds in the statistical rolling window that metrics are retained for.- Parameters:
rollingWindow- the value of therolling_windowparameter as along, wrapped in anOptional- Returns:
- this builder instance
-
numBuckets
Integer number of buckets into which metrics are retained. Max 128.- Parameters:
numBuckets- the value of thenum_bucketsparameter as along- Returns:
- this builder instance
-
numBuckets
Integer number of buckets into which metrics are retained. Max 128.- Parameters:
numBuckets- the value of thenum_bucketsparameter as along, wrapped in anOptional- Returns:
- this builder instance
-
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 thevolume_thresholdparameter as along- Returns:
- this builder instance
-
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 thevolume_thresholdparameter as along, wrapped in anOptional- Returns:
- this builder instance
-
errorThresholdPercentage
Error threshold percentage should be between 0 - 1.0, not 0-100.0- Parameters:
errorThresholdPercentage- the value of theerror_threshold_percentageparameter as adouble- 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 theerror_threshold_percentageparameter as adouble, wrapped in anOptional- Returns:
- this builder instance
-
build
Constructs theEndpointCircuitBreakerinstance.- Returns:
- a new
EndpointCircuitBreaker
-