@Test public void testMetricNameWithTags() { assertEquals("metric.t1:v1.t2:v2:", Metric.getMetricNameWithTags("metric", "t1", "v1", "t2", "v2:")); }
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(); }
Metric implements Serializable { 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(); } }
Metric implements Serializable { 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(); } Metric(MetricsSystem.InstanceType instanceType, String source,
      MetricType metricType, String name, Double value); }
Metric implements Serializable { 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(); } Metric(MetricsSystem.InstanceType instanceType, String source,
      MetricType metricType, String name, Double value); void addValue(double delta); void setValue(double value); double getValue(); MetricsSystem.InstanceType getInstanceType(); void addTag(String name, String value); String getSource(); MetricType getMetricType(); String getName(); Map<String, String> getTags(); @Override boolean equals(Object other); @Override int hashCode(); String getFullMetricName(); alluxio.grpc.Metric toProto(); static String getMetricNameWithTags(String name, String... tags); static String getMetricNameWithUserTag(String metricName, String userName); static String getTagUfsValueFromFullName(String fullName); static Metric from(String fullName, double value, MetricType metricType); static Metric fromProto(alluxio.grpc.Metric metric); @Override String toString(); }
Metric implements Serializable { 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(); } Metric(MetricsSystem.InstanceType instanceType, String source,
      MetricType metricType, String name, Double value); void addValue(double delta); void setValue(double value); double getValue(); MetricsSystem.InstanceType getInstanceType(); void addTag(String name, String value); String getSource(); MetricType getMetricType(); String getName(); Map<String, String> getTags(); @Override boolean equals(Object other); @Override int hashCode(); String getFullMetricName(); alluxio.grpc.Metric toProto(); static String getMetricNameWithTags(String name, String... tags); static String getMetricNameWithUserTag(String metricName, String userName); static String getTagUfsValueFromFullName(String fullName); static Metric from(String fullName, double value, MetricType metricType); static Metric fromProto(alluxio.grpc.Metric metric); @Override String toString(); static final String TAG_SEPARATOR; }