All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.circonus.metrics.DefaultMetricNameFormatter Maven / Gradle / Ivy

package com.circonus.metrics;

public class DefaultMetricNameFormatter implements MetricNameFormatter {

  public String format(String name, String... path) {
    final StringBuilder sb = new StringBuilder();

    String[] metricParts = name.split("\\[");
    sb.append(metricParts[0]);

    for (String part : path) {
        sb.append('.').append(part);
    }

    for (int i = 1; i < metricParts.length; i++) {
        sb.append('[').append(metricParts[i]);
    }
    return sb.toString();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy