/[projects]/CircuitBreaker/src/dk/thoerup/curcuitbreaker/AccountingCircuitBreaker.java
ViewVC logotype

Diff of /CircuitBreaker/src/dk/thoerup/curcuitbreaker/AccountingCircuitBreaker.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 403 by torben, Wed Oct 7 04:14:14 2009 UTC revision 404 by torben, Wed Oct 7 04:17:45 2009 UTC
# Line 9  public class AccountingCircuitBreaker ex Line 9  public class AccountingCircuitBreaker ex
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);
# Line 51  public class AccountingCircuitBreaker ex Line 51  public class AccountingCircuitBreaker ex
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() {
# Line 65  public class AccountingCircuitBreaker ex Line 65  public class AccountingCircuitBreaker ex
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  }  }

Legend:
Removed from v.403  
changed lines
  Added in v.404

  ViewVC Help
Powered by ViewVC 1.1.20