@Test public void testSustainedErrorTriggers() throws Exception { final ErrorRateMonitor errorMonitor = new ErrorRateMonitor(20, 1, 10); errorMonitor.addPolicy(new SimpleErrorCheckPolicy(130, 8, 80)); errorMonitor.addPolicy(new SimpleErrorCheckPolicy(200, 4, 80)); List<Integer> rates = CollectionUtils.newArrayList(130, 140, 180); int errorCount = runTest(9, errorMonitor, rates); Assert.assertEquals(1, errorCount); }
public void addPolicy(ErrorCheckPolicy policy) { policies.add(policy); }
ErrorRateMonitor { public void addPolicy(ErrorCheckPolicy policy) { policies.add(policy); } }
ErrorRateMonitor { public void addPolicy(ErrorCheckPolicy policy) { policies.add(policy); } ErrorRateMonitor(int windowSize, int checkFrequency, int suppressWindow);  ErrorRateMonitor(ErrorRateMonitorConfig config); }
ErrorRateMonitor { public void addPolicy(ErrorCheckPolicy policy) { policies.add(policy); } ErrorRateMonitor(int windowSize, int checkFrequency, int suppressWindow);  ErrorRateMonitor(ErrorRateMonitorConfig config); void addPolicy(ErrorCheckPolicy policy); boolean trackErrorRate(int count); }
ErrorRateMonitor { public void addPolicy(ErrorCheckPolicy policy) { policies.add(policy); } ErrorRateMonitor(int windowSize, int checkFrequency, int suppressWindow);  ErrorRateMonitor(ErrorRateMonitorConfig config); void addPolicy(ErrorCheckPolicy policy); boolean trackErrorRate(int count);  }