code: Map<String, String> extractParameters(final String metricName) {
          final Matcher matcher = this.pattern.matcher(metricName);
          final Map<String, String> params = new HashMap<String, String>();
          if (matcher.find()) {
              for (int i = 1; i <= matcher.groupCount(); i++) {
                  params.put(String.format("${%d}", i - 1), matcher.group(i));
              }
          }
  
          return params;
      }
docs: Extracts parameters from the given metric name based on the pattern.
  The resulting map has keys named as '${n}' where n is the 0 based position in the pattern.
  E.g.:
  pattern: org.test.controller.*.status.*
  extractParameters("org.test.controller.gather.status.400") ->
  {${0} -> "gather", ${1} -> "400"}
  
  @param metricName The metric name to extract parameters from.
  @return A parameter map where keys are named '${n}' where n is 0 based parameter position in the pattern.