DurationThresholdTracker { public void markDurationThresholds(final long duration) { if (duration <= threshold) { durationThresholdMeter.mark(); } } DurationThresholdTracker(MetricId id, SemanticMetricRegistry
      metricRegistry, Integer threshold); void markDurationThresholds(final long duration);  }
@Test public void markDurationThresholds() throws Exception { final Meter meter = registry.getMeters().get(metricId.tagged("what", ENDPOINT_REQUEST_DURATION_THRESHOLD_RATE.tag()).tagged("threshold", "50")); durationThresholdTracker.markDurationThresholds(20); durationThresholdTracker.markDurationThresholds(50); durationThresholdTracker.markDurationThresholds(100); final long count = meter.getCount(); assertEquals(2, count); }