some more bstats
This commit is contained in:
parent
2f055e59cf
commit
5c1c487457
1 changed files with 11 additions and 0 deletions
|
@ -11,6 +11,7 @@ import java.util.Random;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.bstats.bukkit.Metrics;
|
import org.bstats.bukkit.Metrics;
|
||||||
|
import org.bstats.charts.SimplePie;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
@ -57,6 +58,16 @@ public class Main extends JavaPlugin implements Listener, CommandExecutor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
metrics.addCustomChart(new SimplePie("ram_allocation", () -> {
|
||||||
|
long maxMemory = Runtime.getRuntime().maxMemory();
|
||||||
|
if (maxMemory == Long.MAX_VALUE) {
|
||||||
|
return "No limit";
|
||||||
|
}
|
||||||
|
return Integer.toString(Math.round(maxMemory/512) * 512);
|
||||||
|
}));
|
||||||
|
metrics.addCustomChart(new SimplePie("os_arch", () -> {
|
||||||
|
return System.getProperty("os.arch");
|
||||||
|
}));
|
||||||
if (!(configFile.exists())) {
|
if (!(configFile.exists())) {
|
||||||
saveResource("config.yml", false);
|
saveResource("config.yml", false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue