use of org.gluu.model.metric.counter.CounterMetricData in project oxCore by GluuFederation.
the class LdapEntryReporter method builCounterEntries.
private List<MetricEntry> builCounterEntries(SortedMap<String, Counter> counters, Set<MetricType> registeredMetricTypes) {
List<MetricEntry> result = new ArrayList<MetricEntry>();
Set<MetricType> currentRegisteredMetricTypes = new HashSet<MetricType>(registeredMetricTypes);
for (MetricType metricType : currentRegisteredMetricTypes) {
Counter counter = counters.get(metricType.getValue());
if (counter != null) {
long count = counter.getCount();
// Remove to avoid writing not changed statistic
// registeredMetricTypes.remove(metricType);
CounterMetricData counterMetricData = new CounterMetricData(count);
CounterMetricEntry counterMetricEntry = new CounterMetricEntry();
counterMetricEntry.setMetricData(counterMetricData);
counterMetricEntry.setMetricType(metricType);
result.add(counterMetricEntry);
}
}
return result;
}
Aggregations