dbConfig.setReadOnly(true);
dbConfig.setAllowCreate(false);
DbInternal.setUseExistingConfig(dbConfig, true);
Database db = env.openDatabase(null, dbName, dbConfig);
StatsConfig statsConfig = new StatsConfig();
if (progressInterval > 0) {
statsConfig.setShowProgressInterval(progressInterval);
statsConfig.setShowProgressStream(out);
}
DatabaseStats stats = db.getStats(statsConfig);
out.println(stats);