use of co.cask.cdap.proto.MetricTagValue in project cdap by caskdata.
the class MetricsQueryHelper method parseTagValues.
private List<MetricTagValue> parseTagValues(List<String> tags) {
List<MetricTagValue> result = Lists.newArrayList();
for (String tag : tags) {
// split by ':' and add the tagValue to result list
String[] tagSplit = tag.split(":", 2);
if (tagSplit.length == 2) {
String value = tagSplit[1].equals(ANY_TAG_VALUE) ? null : tagSplit[1];
result.add(new MetricTagValue(tagSplit[0], value));
}
}
return result;
}
use of co.cask.cdap.proto.MetricTagValue in project cdap by caskdata.
the class MetricsQueryHelper method parseTagValuesAsMap.
private Map<String, String> parseTagValuesAsMap(List<String> tags) {
List<MetricTagValue> tagValues = parseTagValues(tags);
Map<String, String> result = Maps.newHashMap();
for (MetricTagValue tagValue : tagValues) {
result.put(tagValue.getName(), tagValue.getValue());
}
return result;
}
Aggregations