use of com.sleepycat.je.utilint.StatDefinition in project qpid-broker-j by apache.
the class EnvironmentUtils method getStatsFromStatGroup.
private static Map<String, Map<String, Object>> getStatsFromStatGroup(final Collection<StatGroup> statGroups) {
Map<String, Map<String, Object>> results = new LinkedHashMap<>();
for (StatGroup group : statGroups) {
Map<String, Object> groupResults = new TreeMap<>();
for (Map.Entry<StatDefinition, Stat<?>> entry : group.getStats().entrySet()) {
if (!entry.getValue().isNotSet()) {
Object value = entry.getValue().get();
if (value instanceof IntegralLongAvg) {
value = ((Number) value).doubleValue();
}
groupResults.put(entry.getKey().getName(), value);
}
}
if (!groupResults.isEmpty()) {
results.put(group.getName(), groupResults);
}
}
return results;
}
Aggregations