code: private int metricName_index(dictionary_delta dict_delta, MetricName metric) {
          final BiMap<MetricName, Integer> dict = from_.getMetricDict().inverse();
          final Integer resolved = dict.get(metric);
          if (resolved != null) return resolved;
  
          final int allocated = allocate_index_(dict);
          dict.put(metric, allocated);
  
          // Create new pdd for serialization.
          path_dictionary_delta mdd = new path_dictionary_delta();
          mdd.id = allocated;
          mdd.value = new_path_(metric.getPath());
          // Append new entry to array.
          dict_delta.mdd = Stream.concat(Arrays.stream(dict_delta.mdd), Stream.of(mdd))
                  .toArray(path_dictionary_delta[]::new);
          LOG.log(Level.FINE, "dict_delta.mdd: {0} items (added {1})", new Object[]{dict_delta.mdd.length, metric});
  
          return allocated;
      }
docs: Lookup the index for the argument, or if it isn't present, create one.