9 |
private AtomicInteger totalFailureCount = new AtomicInteger(0); //how many times has the backend thrown an exception |
private AtomicInteger totalFailureCount = new AtomicInteger(0); //how many times has the backend thrown an exception |
10 |
private AtomicInteger totalCallCount = new AtomicInteger(0); |
private AtomicInteger totalCallCount = new AtomicInteger(0); |
11 |
|
|
12 |
private long lastReset = 0; |
private long lastResetCounters = 0; |
13 |
|
|
14 |
public AccountingCircuitBreaker(String name, int threshold, long timeoutMS) { |
public AccountingCircuitBreaker(String name, int threshold, long timeoutMS) { |
15 |
super(name, threshold, timeoutMS); |
super(name, threshold, timeoutMS); |
51 |
return totalFailureCount.get(); |
return totalFailureCount.get(); |
52 |
} |
} |
53 |
|
|
54 |
public long getLastReset() { |
public long getLastResetCounters() { |
55 |
return lastReset; |
return lastResetCounters; |
56 |
} |
} |
57 |
|
|
58 |
public int getTotalCallCount() { |
public int getTotalCallCount() { |
65 |
totalFailureCount.set(0); |
totalFailureCount.set(0); |
66 |
totalCallCount.set(0); |
totalCallCount.set(0); |
67 |
|
|
68 |
lastReset = System.currentTimeMillis(); |
lastResetCounters = System.currentTimeMillis(); |
69 |
} |
} |
70 |
|
|
71 |
} |
} |