class PerformanceProvider {

    /**
     * last refresh timestamp
     */
    private final AtomicLong lastRefreshMillis = new AtomicLong(System.currentTimeMillis());

    private final MMAPCounter mmapCounter = new MMAPCounter();

    public void completeTask(long rt) {
        mmapCounter.add(rt);
    }

    public PerformanceSnapshot getSnapshotAndReset() {<FILL_FUNCTION_BODY>}

    private void reset(long currentMillis) {
        mmapCounter.reset();
        lastRefreshMillis.compareAndSet(lastRefreshMillis.get(), currentMillis);
    }

    @Getter
    public static class PerformanceSnapshot {

        private final double tps;

        private final long maxRt;

        private final long minRt;

        private final double avg;

        private final double tp50;

        private final double tp75;

        private final double tp90;

        private final double tp95;

        private final double tp99;

        private final double tp999;

        public PerformanceSnapshot(MMAPCounter mmapCounter, int monitorInterval) {
            tps = BigDecimal.valueOf(mmapCounter.getMmaCounter().getCount())
                    .divide(BigDecimal.valueOf(Math.max(monitorInterval, 1)), 1, RoundingMode.HALF_UP)
                    .doubleValue();

            maxRt = mmapCounter.getMmaCounter().getMax();
            minRt = mmapCounter.getMmaCounter().getMin();
            avg = mmapCounter.getMmaCounter().getAvg();

            tp50 = mmapCounter.getSnapshot().getMedian();
            tp75 = mmapCounter.getSnapshot().get75thPercentile();
            tp90 = mmapCounter.getSnapshot().getValue(0.9);
            tp95 = mmapCounter.getSnapshot().get95thPercentile();
            tp99 = mmapCounter.getSnapshot().get99thPercentile();
            tp999 = mmapCounter.getSnapshot().get999thPercentile();
        }
    }
}

        long currentMillis = System.currentTimeMillis();
        int intervalTs = (int) (currentMillis - lastRefreshMillis.get()) / 1000;
        val performanceSnapshot = new PerformanceSnapshot(mmapCounter, intervalTs);
        reset(currentMillis);
        return performanceSnapshot;
    
<no_super_class>