docs: private void addMetric(TopologyMaster.MetricDatum metricDatum) {
      String componentName = metricDatum.getComponentName();
      String instanceId = metricDatum.getInstanceId();
      String metricName = metricDatum.getName();
  
      assureComponentInstance(componentName, instanceId);
      assureMetricName(metricName);
      // calc bucket idx
      int idx1 = idxComponentInstance.get(componentName).get(instanceId);
      int idx2 = idxMetricName.get(metricName);
      long bucketId = makeBucketId(idx1, idx2);
  
      // fetch the bucket
      Map.Entry<Long, Map<Long, LinkedList<MetricDatapoint>>> entry =
          cacheMetric.floorEntry(metricDatum.getTimestamp());
      if (entry != null) {
        Map<Long, LinkedList<MetricDatapoint>> locator = entry.getValue();
        if (!locator.containsKey(bucketId)) {
          locator.put(bucketId, new LinkedList<MetricDatapoint>());
        }
        LinkedList<MetricDatapoint> bucket = locator.get(bucketId);
        // store the metric
        MetricDatapoint datum =
            new MetricDatapoint(metricDatum.getTimestamp(), metricDatum.getValue());
        bucket.offerFirst(datum);
      } else {
        LOG.warning("too old metric, out of cache timestamp window, drop it: " + metricDatum);
      }
    }