default boolean isExpiredCache(Model model, Metrics cachedValue, long currentTimeMillis, int ttl) {
        final long metricTimestamp = TimeBucket.getTimestamp(
            cachedValue.getTimeBucket(), model.getDownsampling());
        // If the cached metric is older than the TTL indicated.
        return currentTimeMillis - metricTimestamp > TimeUnit.DAYS.toMillis(ttl);
    }
Calculate the expired status of the metric by given current timestamp, metric and TTL.

@param model             of the given cached value
@param cachedValue       is a metric instance
@param currentTimeMillis current system time of OAP.
@param ttl               from core setting.
@return true if the metric is expired.
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/storage/IMetricsDAO.java