1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-21 05:51:56 +02:00

Show write queue size on /gc

This commit is contained in:
snowleo
2012-10-08 22:48:52 +02:00
parent 524531a090
commit 591d4af167
2 changed files with 6 additions and 3 deletions

View File

@@ -6,8 +6,6 @@ import org.bukkit.World;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
public class Commandgc extends EssentialsCommand public class Commandgc extends EssentialsCommand
{ {
@Override @Override
@@ -31,6 +29,7 @@ public class Commandgc extends EssentialsCommand
sender.sendMessage(_("gcmax", (Runtime.getRuntime().maxMemory() / 1024 / 1024))); sender.sendMessage(_("gcmax", (Runtime.getRuntime().maxMemory() / 1024 / 1024)));
sender.sendMessage(_("gctotal", (Runtime.getRuntime().totalMemory() / 1024 / 1024))); sender.sendMessage(_("gctotal", (Runtime.getRuntime().totalMemory() / 1024 / 1024)));
sender.sendMessage(_("gcfree", (Runtime.getRuntime().freeMemory() / 1024 / 1024))); sender.sendMessage(_("gcfree", (Runtime.getRuntime().freeMemory() / 1024 / 1024)));
sender.sendMessage("Essentials write queue size: " + ess.getStorageQueue().getQueueSize()); //TODO:TL
for (World w : server.getWorlds()) for (World w : server.getWorlds())
{ {

View File

@@ -7,7 +7,6 @@ import java.util.concurrent.Delayed;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger;
import net.ess3.api.IPlugin; import net.ess3.api.IPlugin;
@@ -86,6 +85,11 @@ public class StorageQueue implements Runnable
} }
} }
public int getQueueSize()
{
return queue.size();
}
private class WriteRequest implements Delayed private class WriteRequest implements Delayed
{ {