@Test public void testMoreThanMaxThrottles() { ThrottlingReporter reporter = new LogTestingThrottingReporter(1, SHARD_ID); reporter.throttled(); reporter.throttled(); verify(throttleLog).warn(anyString()); verify(throttleLog).error(anyString()); }
public void throttled() { consecutiveThrottles++; String message = "Shard '" + shardId + "' has been throttled " + consecutiveThrottles + " consecutively"; if (consecutiveThrottles > maxConsecutiveWarnThrottles) { getLog().error(message); } else { getLog().warn(message); } }
ThrottlingReporter { public void throttled() { consecutiveThrottles++; String message = "Shard '" + shardId + "' has been throttled " + consecutiveThrottles + " consecutively"; if (consecutiveThrottles > maxConsecutiveWarnThrottles) { getLog().error(message); } else { getLog().warn(message); } } }
ThrottlingReporter { public void throttled() { consecutiveThrottles++; String message = "Shard '" + shardId + "' has been throttled " + consecutiveThrottles + " consecutively"; if (consecutiveThrottles > maxConsecutiveWarnThrottles) { getLog().error(message); } else { getLog().warn(message); } }  }
ThrottlingReporter { public void throttled() { consecutiveThrottles++; String message = "Shard '" + shardId + "' has been throttled " + consecutiveThrottles + " consecutively"; if (consecutiveThrottles > maxConsecutiveWarnThrottles) { getLog().error(message); } else { getLog().warn(message); } }  void throttled(); void success(); }
ThrottlingReporter { public void throttled() { consecutiveThrottles++; String message = "Shard '" + shardId + "' has been throttled " + consecutiveThrottles + " consecutively"; if (consecutiveThrottles > maxConsecutiveWarnThrottles) { getLog().error(message); } else { getLog().warn(message); } }  void throttled(); void success();  }