mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2026-05-03 11:40:29 +00:00
Introduce /rdebug command to expose some pool statistics.
This commit is contained in:
@@ -314,7 +314,7 @@ class RedisBungeeCommands {
|
||||
private final RedisBungee plugin;
|
||||
|
||||
PlistCommand(RedisBungee plugin) {
|
||||
super("plist", "redisbungee.command.plist", "redisbungee", "rplist");
|
||||
super("plist", "redisbungee.command.plist", "rplist");
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@@ -360,4 +360,23 @@ class RedisBungeeCommands {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static class DebugCommand extends Command {
|
||||
private final RedisBungee plugin;
|
||||
|
||||
DebugCommand(RedisBungee plugin) {
|
||||
super("rdebug", "redisbungee.command.debug");
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(final CommandSender sender, final String[] args) {
|
||||
TextComponent poolActiveStat = new TextComponent("Currently active pool objects: " + plugin.getPool().getNumActive());
|
||||
TextComponent poolIdleStat = new TextComponent("Currently idle pool objects: " + plugin.getPool().getNumIdle());
|
||||
TextComponent poolWaitingStat = new TextComponent("Waiting on free objects: " + plugin.getPool().getNumWaiters());
|
||||
sender.sendMessage(poolActiveStat);
|
||||
sender.sendMessage(poolIdleStat);
|
||||
sender.sendMessage(poolWaitingStat);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user