SamplingBreakerSettings: {
    failureThreshold?: number;
    minimumRps?: number;
    sampleTimeSpan?: ITimeSpan;
    successThreshold?: number;
    timeSpan?: ITimeSpan;
}

IMPORT_PATH: "@daiso-tech/core/circuit-breaker/policies"

Type declaration

  • OptionalfailureThreshold?: number

    Percentage (from 0 to 1) failures before going from closed -> open.

    0.2
    
  • OptionalminimumRps?: number

    The minimum number of calls per seconds to go from closed -> open, half-opened -> closed or half-opened -> open.

    5
    
  • OptionalsampleTimeSpan?: ITimeSpan

    Length of time over which to sample.

    import { TimeSpan } from "@daiso-tech/core/time-span";

    TimeSpan.fromTimeSpan(settings.timeSpan).divide(6)
  • OptionalsuccessThreshold?: number

    Percentage (from 0 to 1) successes before going from half-open -> closed.

    1 - settings.failureThreshold
    
  • OptionaltimeSpan?: ITimeSpan

    Length of time over which to sample.

    import { TimeSpan } from "@daiso-tech/core/time-span";

    TimeSpan.fromMinutes(1)