if (pool == null) {
// TODO: Should we handle this properly??
return;
}
Statistics stats = pool.getStatistics();
MetricTreeObject subtree = tree.getSubtree(key);
subtree.addInt("hitCount", stats.getCacheHits());
subtree.addInt("missCount", stats.getCacheMiss());
subtree.addInt("connectionsRequested", stats.getConnectionsRequested());
subtree.addInt("statementsCached", stats.getStatementsCached());
subtree.addInt("statementsExecuted", stats.getStatementsExecuted());
subtree.addInt("statementsPrepared", stats.getStatementsPrepared());
subtree.addInt("cumulativeConnectionWaitTime", stats.getCumulativeConnectionWaitTime());
subtree.addInt("cumulativeStatementExecutionTime", stats.getCumulativeStatementExecutionTime());
subtree.addInt("cumulativeStatementPrepareTime", stats.getCumulativeStatementPrepareTime());
}