use of com.sleepycat.je.utilint.StatGroup 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;
}
use of com.sleepycat.je.utilint.StatGroup in project qpid-broker-j by apache.
the class EnvironmentUtils method getEnvironmentStatistics.
public static Map<String, Map<String, Object>> getEnvironmentStatistics(Environment environment, boolean reset) {
StatsConfig config = new StatsConfig();
config.setClear(reset);
config.setFast(false);
EnvironmentStats stats = environment.getStats(config);
Collection<StatGroup> statGroups = stats.getStatGroups();
return getStatsFromStatGroup(statGroups);
}
Aggregations