private void padPresentation(Bucket toPresent) {
        Map<String, List<Entry<Point, UntypedMetric>>> currentMetricNames = toPresent.getValuesByMetricName();

        for (Map.Entry<String, List<Entry<Point, UntypedMetric>>> metric : currentMetricNames.entrySet()) {
            final int currentDataPoints = metric.getValue().size();
            if (currentDataPoints < pointsToKeep) {
                padMetric(metric.getKey(), toPresent, currentDataPoints);
            }
        }
        Set<String> keysMissingFromPresentation = new HashSet<>(persistentData.keySet());
        keysMissingFromPresentation.removeAll(currentMetricNames.keySet());
        for (String cachedMetric : keysMissingFromPresentation) {
            padMetric(cachedMetric, toPresent, 0);
        }
    }
The persistence layer for metrics. Both CPU and memory hungry, but
it runs in its own little world.

@author Steinar Knutsen
container-core/src/main/java/com/yahoo/metrics/simple/DimensionCache.java