summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-09-15 22:04:18 +0100
committerKHobbits <rob@khobbits.co.uk>2012-09-15 22:04:18 +0100
commitbc0f5e76ae2fa031a2229256c595a8486e3878ba (patch)
tree72d810bee49992c11bf7822b6f33c9e0d0f71260
parentbb0ff457f65f3a531083f290d97ae0b6d255d811 (diff)
downloadEssentials-bc0f5e76ae2fa031a2229256c595a8486e3878ba.tar
Essentials-bc0f5e76ae2fa031a2229256c595a8486e3878ba.tar.gz
Essentials-bc0f5e76ae2fa031a2229256c595a8486e3878ba.tar.lz
Essentials-bc0f5e76ae2fa031a2229256c595a8486e3878ba.tar.xz
Essentials-bc0f5e76ae2fa031a2229256c595a8486e3878ba.zip
Add server uptime to /gc
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandgc.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
index e1e3cb38d..11af52b6f 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandgc.java
@@ -1,6 +1,8 @@
package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
+import com.earth2me.essentials.Util;
+import java.lang.management.ManagementFactory;
import org.bukkit.ChatColor;
import org.bukkit.Server;
import org.bukkit.World;
@@ -31,10 +33,12 @@ public class Commandgc extends EssentialsCommand
{
color = ChatColor.RED;
}
+
+ sender.sendMessage(_("uptime", Util.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime())));
sender.sendMessage(_("tps", "" + color + tps));
sender.sendMessage(_("gcmax", (Runtime.getRuntime().maxMemory() / 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)));
for (World w : server.getWorlds())
{
@@ -54,5 +58,6 @@ public class Commandgc extends EssentialsCommand
+ w.getLoadedChunks().length + _("gcchunks")
+ w.getEntities().size() + _("gcentities"));
}
+
}
}