3 |
import java.util.concurrent.atomic.AtomicInteger; |
import java.util.concurrent.atomic.AtomicInteger; |
4 |
import java.util.concurrent.atomic.AtomicLong; |
import java.util.concurrent.atomic.AtomicLong; |
5 |
|
|
6 |
|
import dk.thoerup.circuitbreaker.config.BreakerConfig; |
7 |
|
|
8 |
public class AccountingCircuitBreaker extends CircuitBreaker { |
public class AccountingCircuitBreaker extends CircuitBreaker { |
9 |
|
|
10 |
private AtomicInteger tripCount = new AtomicInteger(0); // how many times ahs the CB tripped |
private AtomicInteger tripCount = new AtomicInteger(0); // how many times ahs the CB tripped |
20 |
|
|
21 |
private long lastResetCounters = 0; |
private long lastResetCounters = 0; |
22 |
|
|
23 |
public AccountingCircuitBreaker(String name, int threshold, int timeoutMS) { |
public AccountingCircuitBreaker(String name, BreakerConfig config) { |
24 |
super(name, threshold, timeoutMS); |
super(name, config); |
25 |
|
|
26 |
resetCounters(); |
resetCounters(); |
27 |
} |
} |