code: public List<InMemoryHistoryNode> getMetrics(final String metricName, final Date from,
        final Date to,
        final Boolean useStats) throws ClassCastException {
      final LinkedList<InMemoryHistoryNode> selectedLists = new LinkedList<>();
      if (this.historyListMapping.containsKey(metricName)) {
  
        logger.debug("selecting snapshots within time frame");
        synchronized (this.historyListMapping.get(metricName)) {
          for (final InMemoryHistoryNode node : this.historyListMapping.get(metricName)) {
            if (node.getTimestamp().after(from) && node.getTimestamp().before(to)) {
              selectedLists.add(node);
            }
            if (node.getTimestamp().after(to)) {
              break;
            }
          }
        }
  
        // selecting nodes if num of nodes > numInstances
        if (useStats) {
          statBasedSelectMetricHistory(selectedLists);
        } else {
          generalSelectMetricHistory(selectedLists);
        }
      }
      cleanUsingTime(metricName, new Date());
      return selectedLists;
    }
docs: Get snapshots for a given metric at a given time
  
  @param metricName name of the metric
  @param from Start date
  @param to end date
  @param useStats get statistically significant points only
  @return List of snapshots