@Override
    public final void calculate() {
        if (!isCalculated) {
            long total = dataset.sumOfValues();

            int[] roofs = new int[RANKS.length];
            for (int i = 0; i < RANKS.length; i++) {
                roofs[i] = Math.round(total * RANKS[i] * 1.0f / 100);
            }

            long count = 0;
            final List<String> sortedKeys = dataset.sortedKeys(Comparator.comparingInt(Integer::parseInt));

            int loopIndex = 0;
            for (String key : sortedKeys) {
                final Long value = dataset.get(key);

                count += value;
                for (int rankIdx = loopIndex; rankIdx < roofs.length; rankIdx++) {
                    int roof = roofs[rankIdx];

                    if (count >= roof) {
                        DataLabel label = new DataLabel();
                        label.put(PERCENTILE_LABEL_NAME, String.valueOf(RANKS[rankIdx]));
                        percentileValues.put(label.toString(), Long.parseLong(key) * precision);
                        loopIndex++;
                    } else {
                        break;
                    }
                }
            }
        }
    }
Replace the deprecated {@link PercentileMetrics}.
Calculate the multiple P50/75/90/95/99 values once for all
and store the result in the format: `{p=50},value1|{p=75},value2|{p=90},value3|{p=95},value4|{p=99},value5`.

@since 10.0.0
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/metrics/PercentileMetrics2.java