Search in sources :

Example 1 with DomainMetricType

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;
}
Also used : DomainMetrics(com.yahoo.athenz.zts.DomainMetrics) DomainMetric(com.yahoo.athenz.zts.DomainMetric) ArrayList(java.util.ArrayList) DomainMetricType(com.yahoo.athenz.zts.DomainMetricType)

Aggregations

DomainMetric (com.yahoo.athenz.zts.DomainMetric)1 DomainMetricType (com.yahoo.athenz.zts.DomainMetricType)1 DomainMetrics (com.yahoo.athenz.zts.DomainMetrics)1 ArrayList (java.util.ArrayList)1