@Test public void extractParameters_WHEN_moreDots_THEN_ShouldReturnNoMatches() { GraphiteNamePattern pattern; pattern = new GraphiteNamePattern("org.test.controller.*.status.*"); Assertions.assertThat(pattern.extractParameters("org.test.controller...status.400")) .isEqualTo(Collections.emptyMap()); }
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; }
GraphiteNamePattern { 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; } }
GraphiteNamePattern { 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; } GraphiteNamePattern(final String pattern); }
GraphiteNamePattern { 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; } GraphiteNamePattern(final String pattern);  }
GraphiteNamePattern { 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; } GraphiteNamePattern(final String pattern);   }