@Test public void testCanParseWithMultipleSegments() { assertMetricNameMatches(MetricName.parse("a.b"), "a.b", null, "a.b"); }
public static MetricName parse(String metric) { Matcher m = METRIC_PATTERN.matcher(metric); if (!m.matches()) { throw new IllegalArgumentException(String.format("invalid metric name '%s'", metric)); } return new MetricName(m.group(METRIC_PREFIX_INDEX), m.group(METRIC_SUFFIX_INDEX), m .group(METRIC_INSTANCE_INDEX)); }
MetricName { public static MetricName parse(String metric) { Matcher m = METRIC_PATTERN.matcher(metric); if (!m.matches()) { throw new IllegalArgumentException(String.format("invalid metric name '%s'", metric)); } return new MetricName(m.group(METRIC_PREFIX_INDEX), m.group(METRIC_SUFFIX_INDEX), m .group(METRIC_INSTANCE_INDEX)); } }
MetricName { public static MetricName parse(String metric) { Matcher m = METRIC_PATTERN.matcher(metric); if (!m.matches()) { throw new IllegalArgumentException(String.format("invalid metric name '%s'", metric)); } return new MetricName(m.group(METRIC_PREFIX_INDEX), m.group(METRIC_SUFFIX_INDEX), m .group(METRIC_INSTANCE_INDEX)); } private  MetricName(String prefix, String suffix, String instance); }
MetricName { public static MetricName parse(String metric) { Matcher m = METRIC_PATTERN.matcher(metric); if (!m.matches()) { throw new IllegalArgumentException(String.format("invalid metric name '%s'", metric)); } return new MetricName(m.group(METRIC_PREFIX_INDEX), m.group(METRIC_SUFFIX_INDEX), m .group(METRIC_INSTANCE_INDEX)); } private  MetricName(String prefix, String suffix, String instance); String getMetric(); String getInstanceDomainTag(); static MetricName parse(String metric); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
MetricName { public static MetricName parse(String metric) { Matcher m = METRIC_PATTERN.matcher(metric); if (!m.matches()) { throw new IllegalArgumentException(String.format("invalid metric name '%s'", metric)); } return new MetricName(m.group(METRIC_PREFIX_INDEX), m.group(METRIC_SUFFIX_INDEX), m .group(METRIC_INSTANCE_INDEX)); } private  MetricName(String prefix, String suffix, String instance); String getMetric(); String getInstanceDomainTag(); static MetricName parse(String metric); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }