use of com.yahoo.athenz.zts.DomainMetricType in project athenz by yahoo.
the class ZpeMetric method getMetrics.
// to convert the atomicIntegerArray to JSON object
public DomainMetrics getMetrics(String domainName) {
ArrayList<DomainMetric> metricList = new ArrayList<>();
for (DomainMetricType label : DomainMetricType.values()) {
DomainMetric domainMetric = new DomainMetric();
domainMetric.setMetricType(label);
domainMetric.setMetricVal(counter.get(domainName).getAndSet(label.ordinal(), 0));
metricList.add(domainMetric);
}
DomainMetrics domainMetrics = new DomainMetrics().setDomainName(domainName).setMetricList(metricList);
return domainMetrics;
}
Aggregations