@Test public void testUpdateRepairTimingFailed() { long expectedTime = 1234; boolean successful = false; myNodeMetricHolder.repairTiming(expectedTime, TimeUnit.NANOSECONDS, successful); assertThat(getTimer(NodeMetricHolder.REPAIR_TIMING_FAILED).getCount()).isEqualTo(1); assertThat(getTimer(NodeMetricHolder.REPAIR_TIMING_FAILED).getSnapshot().getMean()).isEqualTo(expectedTime); assertThat(getTimer(NodeMetricHolder.REPAIR_TIMING_SUCCESS).getCount()).isEqualTo(0); assertThat(getTimer(NodeMetricHolder.REPAIR_TIMING_SUCCESS).getSnapshot().getMean()).isEqualTo(0); }
public void repairTiming(long timeTaken, TimeUnit timeUnit, boolean successful) { if (successful) { timer(REPAIR_TIMING_SUCCESS).update(timeTaken, timeUnit); } else { timer(REPAIR_TIMING_FAILED).update(timeTaken, timeUnit); } }
NodeMetricHolder implements Closeable { public void repairTiming(long timeTaken, TimeUnit timeUnit, boolean successful) { if (successful) { timer(REPAIR_TIMING_SUCCESS).update(timeTaken, timeUnit); } else { timer(REPAIR_TIMING_FAILED).update(timeTaken, timeUnit); } } }
NodeMetricHolder implements Closeable { public void repairTiming(long timeTaken, TimeUnit timeUnit, boolean successful) { if (successful) { timer(REPAIR_TIMING_SUCCESS).update(timeTaken, timeUnit); } else { timer(REPAIR_TIMING_FAILED).update(timeTaken, timeUnit); } } NodeMetricHolder(MetricRegistry metricRegistry, TableStorageStates tableStorageStates); }
NodeMetricHolder implements Closeable { public void repairTiming(long timeTaken, TimeUnit timeUnit, boolean successful) { if (successful) { timer(REPAIR_TIMING_SUCCESS).update(timeTaken, timeUnit); } else { timer(REPAIR_TIMING_FAILED).update(timeTaken, timeUnit); } } NodeMetricHolder(MetricRegistry metricRegistry, TableStorageStates tableStorageStates); void repairState(TableReference tableReference, double repairRatio); void repairTiming(long timeTaken, TimeUnit timeUnit, boolean successful); @Override void close(); }
NodeMetricHolder implements Closeable { public void repairTiming(long timeTaken, TimeUnit timeUnit, boolean successful) { if (successful) { timer(REPAIR_TIMING_SUCCESS).update(timeTaken, timeUnit); } else { timer(REPAIR_TIMING_FAILED).update(timeTaken, timeUnit); } } NodeMetricHolder(MetricRegistry metricRegistry, TableStorageStates tableStorageStates); void repairState(TableReference tableReference, double repairRatio); void repairTiming(long timeTaken, TimeUnit timeUnit, boolean successful); @Override void close();  }