@@ -0,0 +1,1844 @@
+/*%0A *    Copyright 2016 Vladimir Bukhtoyarov%0A *%0A *      Licensed under the Apache License, Version 2.0 (the %22License%22);%0A *      you may not use this file except in compliance with the License.%0A *      You may obtain a copy of the License at%0A *%0A *            http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *     Unless required by applicable law or agreed to in writing, software%0A *     distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *     See the License for the specific language governing permissions and%0A *     limitations under the License.%0A */%0A%0Apackage com.github.metricscore.hdr.top;%0A%0A%0Aimport com.github.metricscore.hdr.top.basic.BasicQueryTop;%0Aimport com.github.metricscore.hdr.top.basic.QueryTopRecorder;%0A%0Aimport java.time.Duration;%0Aimport java.util.List;%0Aimport java.util.concurrent.TimeUnit;%0Aimport java.util.function.Supplier;%0A%0A/**%0A * Created by vladimir.bukhtoyarov on 14.10.2016.%0A */%0Apublic class ResetOnSnapshotQueryTop extends BasicQueryTop %7B%0A%0A    private final QueryTopRecorder recorder;%0A    private QueryTop intervalQueryTop;%0A%0A    ResetOnSnapshotQueryTop(int size, Duration slowQueryThreshold) %7B%0A        super(size, slowQueryThreshold);%0A        this.recorder = new QueryTopRecorder(size, slowQueryThreshold);%0A    %7D%0A%0A    @Override%0A    synchronized public List%3CLatencyWithDescription%3E getDescendingRaiting() %7B%0A        intervalQueryTop = recorder.getIntervalQueryTop();%0A        return intervalQueryTop.getDescendingRaiting();%0A    %7D%0A%0A    @Override%0A    protected void updateImpl(long latencyTime, TimeUnit latencyUnit, Supplier%3CString%3E descriptionSupplier, long latencyNanos) %7B%0A        recorder.update(latencyTime, latencyUnit, descriptionSupplier);%0A    %7D%0A%0A    @Override%0A    public void reset() %7B%0A        recorder.reset();%0A    %7D%0A%0A%7D%0A

implement QueryTop which zeroing its state each time when snapshot taken