public static String getMetricNameWithTags(String name, String... tags) {
    Preconditions.checkArgument(tags.length % 2 == 0,
        "The tag arguments should be tag name and tag value pairs");
    StringBuilder sb = new StringBuilder();
    sb.append(name);
    for (int i = 0; i < tags.length; i += 2) {
      sb.append('.').append(tags[i]).append(TAG_SEPARATOR).append(tags[i + 1]);
    }
    return sb.toString();
  }
@Test
  public void testMetricNameWithTags() {
    assertEquals("metric.t1:v1.t2:v2:",
        Metric.getMetricNameWithTags("metric", "t1", "v1", "t2", "v2:"));
  }