Search in sources :

Example 1 with TransactionStats

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;
}
Also used : TransactionStats(com.sleepycat.je.TransactionStats) StatsConfig(com.sleepycat.je.StatsConfig) ConfiguredObject(org.apache.qpid.server.model.ConfiguredObject) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

StatsConfig (com.sleepycat.je.StatsConfig)1 TransactionStats (com.sleepycat.je.TransactionStats)1 LinkedHashMap (java.util.LinkedHashMap)1 ConfiguredObject (org.apache.qpid.server.model.ConfiguredObject)1