Normal load
No fault, steady traffic
- fluxgo
- — %
- gobreaker
- — %
Results pending
fluxgo moves its failure threshold in real time using EWMA and tail latency, so it trips early when a dependency degrades and stays calm when it is healthy. It is a drop-in for gobreaker.
Benchmarks on an Intel Core i5-11300H @ 3.10 GHz, from the fluxgo README.
Smoothed mean latency, compared against a healthy baseline learned during warmup.
Tail latency over a fixed window, updated in place with zero allocations.
The degradation ratio Dₜ scales the trip threshold, clamped to [θmin, θmax].
Warmup, a minimum dwell time and slow-request classification keep false trips rare.
import "github.com/deaprima/fluxgo"
cb := fluxgo.NewCircuitBreaker(fluxgo.Settings{
Name: "payment-service",
Config: fluxgo.DefaultConfig(),
})
res, err := cb.Execute(func() (any, error) {
return callDownstream()
})
if errors.Is(err, fluxgo.ErrOpenState) {
// circuit is open — serve a fallback
}
Dt = W1·(St/Sbase) + W2·(Pt/Pbase)
latency ×2 → threshold ÷2 → trips at half the failure rate
| Aspect | gobreaker | fluxgo |
|---|---|---|
| Trip threshold | gobreaker Fixed failure ratio | fluxgo Moves with latency (θₜ) |
| Latency signal | gobreaker None | fluxgo EWMA + P95 / P99 |
| Slow requests | gobreaker Ignored unless they error | fluxgo Counted as degraded |
| Cold start | gobreaker — | fluxgo Warmup baseline |
| Flapping guard | gobreaker — | fluxgo Minimum dwell time |
| Observability | gobreaker Counts() | fluxgo Counts() + Snapshot() |
Each scenario runs 30 times per breaker on a four-service Go chain with injected network faults and steady load. Lower is better for every number.
No fault, steady traffic
Results pending
10 → 250 users with a bandwidth cap
Results pending
Latency climbs +50 → +500 ms
Results pending
Hard timeout at second 60
Results pending