use of alluxio.metrics.Metric in project alluxio by Alluxio.
the class SingleTagValueAggregator method updateValues.
@Override
public Map<String, Long> updateValues(Set<Metric> set) {
Map<String, Long> updated = new HashMap<>();
for (Metric metric : set) {
Map<String, String> tags = metric.getTags();
if (tags.containsKey(mTagName)) {
String ufsName = Metric.getMetricNameWithTags(mAggregationName, mTagName, tags.get(mTagName));
long value = updated.getOrDefault(ufsName, 0L);
updated.put(ufsName, (long) (value + metric.getValue()));
}
}
synchronized (this) {
mAggregates = updated;
}
return Collections.unmodifiableMap(mAggregates);
}
Aggregations