--- CircuitBreaker/src/dk/thoerup/curcuitbreaker/AccountingCircuitBreaker.java 2009/10/06 13:17:41 399 +++ CircuitBreaker/src/dk/thoerup/curcuitbreaker/AccountingCircuitBreaker.java 2009/10/06 13:21:12 400 @@ -8,6 +8,8 @@ private AtomicInteger blockCount = new AtomicInteger(0); //how many times has this CB blocked a call that would otherwise go to the backend private AtomicInteger failureCount = new AtomicInteger(0); //how many times has the backend thrown an exception + private long lastReset = 0; + public AccountingCircuitBreaker(String name, int threshold, long timeoutMS) { super(name, threshold, timeoutMS); } @@ -47,10 +49,16 @@ return failureCount.get(); } + public long getLastReset() { + return lastReset; + } + public void resetCounters() { tripCount.set(0); blockCount.set(0); failureCount.set(0); + + lastReset = System.currentTimeMillis(); } }