docs: @Override
    public Snapshot getSnapshot() {
      long now = System.nanoTime();
  
      cacheLock.readLock().lock();
      try {
        if (now - cachedHistogramTimestampNanos < refreshIntervalNanos) {
          return cachedSnapshot;
        }
      } finally {
        cacheLock.readLock().unlock();
      }
  
      cacheLock.writeLock().lock();
      try {
        // Might have raced with another writer => re-check the timestamp
        if (now - cachedHistogramTimestampNanos >= refreshIntervalNanos) {
          LOG.debug("Cached snapshot is too old, refreshing");
          cachedHistogram = recorder.getIntervalHistogram(cachedHistogram);
          cachedSnapshot = new HdrSnapshot(cachedHistogram);
          cachedHistogramTimestampNanos = now;
        }
        return cachedSnapshot;
      } finally {
        cacheLock.writeLock().unlock();
      }
    }