Search in sources :

Example 1 with PrismDataSource

use of me.botsko.prism.database.PrismDataSource in project Prism-Bukkit by prism.

the class DebugCommand method getDataSourceInfo.

private String getDataSourceInfo() {
    PrismDataSource dataSource = Prism.getPrismDataSource();
    StringBuilder out = new StringBuilder();
    String name = dataSource.getClass().getName();
    out.append("DataSource Name: ").append(name).append(System.lineSeparator());
    if (dataSource.getDataSource() instanceof HikariDataSource) {
        HikariDataSource ds = (HikariDataSource) dataSource.getDataSource();
        out.append("Running: ").append(ds.isRunning()).append("Total Connections: ").append(ds.getHikariPoolMXBean().getTotalConnections()).append(System.lineSeparator()).append("Total Connections: ").append(ds.getHikariPoolMXBean().getActiveConnections()).append(System.lineSeparator());
    }
    out.append("Illegal Blocks:").append(System.lineSeparator());
    for (Material mat : Prism.getIllegalBlocks()) {
        out.append("   ").append(mat.name()).append(System.lineSeparator());
    }
    out.append("Worlds Tracked: ").append(Prism.prismWorlds.size()).append(System.lineSeparator());
    out.append("Players Tracked: ").append(Prism.prismPlayers.size()).append(System.lineSeparator());
    out.append("Players with Tools: ").append(Prism.playersWithActiveTools.size()).append(System.lineSeparator());
    return out.toString();
}
Also used : HikariDataSource(com.zaxxer.hikari.HikariDataSource) Material(org.bukkit.Material) PrismDataSource(me.botsko.prism.database.PrismDataSource)

Aggregations

HikariDataSource (com.zaxxer.hikari.HikariDataSource)1 PrismDataSource (me.botsko.prism.database.PrismDataSource)1 Material (org.bukkit.Material)1