use of com.sleepycat.je.TransactionStats in project qpid-broker-j by apache.
the class EnvironmentUtils method getTransactionStatistics.
public static Map<String, Object> getTransactionStatistics(Environment environment, boolean reset) {
StatsConfig config = new StatsConfig();
config.setClear(reset);
config.setFast(false);
final TransactionStats stats = environment.getTransactionStats(config);
Map<String, Object> results = new LinkedHashMap<>();
results.put(TXN_ACTIVE.getName(), stats.getNActive());
results.put(TXN_BEGINS.getName(), stats.getNBegins());
results.put(TXN_COMMITS.getName(), stats.getNCommits());
results.put(TXN_ABORTS.getName(), stats.getNAborts());
results.put(TXN_XAPREPARES.getName(), stats.getNXAPrepares());
results.put(TXN_XACOMMITS.getName(), stats.getNXACommits());
results.put(TXN_XAABORTS.getName(), stats.getNXAAborts());
return results;
}
Aggregations