@Override
    public synchronized void markEvent() {
        eventTimestamps.add(clock.absoluteTimeMillis());
        eventCount++;
    }
@Test
    void testMarkEvent() {
        final ThresholdMeter thresholdMeter = createLargeThresholdMeter();

        thresholdMeter.markEvent();
        clock.advanceTime(SLEEP, TimeUnit.MILLISECONDS);
        assertThat(thresholdMeter.getCount()).isOne();
        assertThat(thresholdMeter.getRate()).isCloseTo(toPerSecondRate(1), within(ERROR));

        thresholdMeter.markEvent();
        assertThat(thresholdMeter.getCount()).isEqualTo(2);
        clock.advanceTime(SLEEP, TimeUnit.MILLISECONDS);
        assertThat(thresholdMeter.getRate()).isCloseTo(toPerSecondRate(2), within(ERROR));
    }