Skip to content

Slow requests

A dependency can degrade without returning errors: every call still succeeds, only much slower. A purely error-based breaker never notices. fluxgo classifies such calls as degraded.

latency > Pt × SlowRequestMargin → counted as a failure internally

With the default SlowRequestMargin = 2.0, a call slower than twice the current P95 counts towards the failure rate.

  • The result and error returned by Execute() are not changed, so your code and gobreaker compatibility are unaffected.
  • The percentile used for the comparison is taken before the current latency enters the window, so a request is never compared with itself.
  • Classification is inactive during warmup and while the rolling window is not yet populated.
snap := cb.Snapshot()
fmt.Println(snap.DegradedRequests) // calls classified as slow so far