Search in sources :

Example 1 with MetricsManager

use of dev.frankheijden.insights.api.metrics.MetricsManager in project Insights by InsightsPlugin.

the class Insights method onEnable.

@Override
public void onEnable() {
    super.onEnable();
    this.audiences = BukkitAudiences.create(this);
    this.listenerManager = new ListenerManager(this);
    reloadConfigs();
    addonManager = new AddonManager(this, getDataFolder().toPath().resolve("addons"));
    try {
        addonManager.createAddonsFolder();
    } catch (IOException ex) {
        ex.printStackTrace();
    }
    getServer().getScheduler().runTaskLater(this, () -> {
        try {
            addonManager.loadAddons();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }, 1);
    playerList = new PlayerList(Bukkit.getOnlinePlayers());
    worldStorage = new WorldStorage();
    addonStorage = new AddonStorage();
    worldChunkScanTracker = new WorldChunkScanTracker();
    addonScanTracker = new AddonScanTracker();
    executor = ContainerExecutorService.newExecutor(settings.SCANS_CONCURRENT_THREADS);
    chunkContainerExecutor = new ChunkContainerExecutor(executor, worldStorage, worldChunkScanTracker);
    metricsManager = new MetricsManager(this);
    scanHistory = new ScanHistory();
    redstoneUpdateCount = new RedstoneUpdateCount(this);
    redstoneUpdateCount.start();
    chunkTeleport = new ChunkTeleport(this);
    loadCommands();
    if (!PaperLib.isPaper()) {
        entityTrackerTask = new EntityTrackerTask(this);
        var interval = settings.SPIGOT_ENTITY_TRACKER_INTERVAL_TICKS;
        Bukkit.getScheduler().runTaskTimer(this, entityTrackerTask, 0, interval);
    }
    reload();
}
Also used : AddonScanTracker(dev.frankheijden.insights.api.concurrent.tracker.AddonScanTracker) ScanHistory(dev.frankheijden.insights.api.concurrent.storage.ScanHistory) CommandScanHistory(dev.frankheijden.insights.commands.CommandScanHistory) PlayerList(dev.frankheijden.insights.api.concurrent.PlayerList) EntityTrackerTask(dev.frankheijden.insights.tasks.EntityTrackerTask) IOException(java.io.IOException) AddonStorage(dev.frankheijden.insights.api.concurrent.storage.AddonStorage) WorldStorage(dev.frankheijden.insights.api.concurrent.storage.WorldStorage) ChunkTeleport(dev.frankheijden.insights.api.concurrent.ChunkTeleport) MetricsManager(dev.frankheijden.insights.api.metrics.MetricsManager) ChunkContainerExecutor(dev.frankheijden.insights.api.concurrent.ChunkContainerExecutor) RedstoneUpdateCount(dev.frankheijden.insights.api.concurrent.count.RedstoneUpdateCount) WorldChunkScanTracker(dev.frankheijden.insights.api.concurrent.tracker.WorldChunkScanTracker) AddonManager(dev.frankheijden.insights.api.addons.AddonManager) ListenerManager(dev.frankheijden.insights.listeners.manager.ListenerManager)

Aggregations

AddonManager (dev.frankheijden.insights.api.addons.AddonManager)1 ChunkContainerExecutor (dev.frankheijden.insights.api.concurrent.ChunkContainerExecutor)1 ChunkTeleport (dev.frankheijden.insights.api.concurrent.ChunkTeleport)1 PlayerList (dev.frankheijden.insights.api.concurrent.PlayerList)1 RedstoneUpdateCount (dev.frankheijden.insights.api.concurrent.count.RedstoneUpdateCount)1 AddonStorage (dev.frankheijden.insights.api.concurrent.storage.AddonStorage)1 ScanHistory (dev.frankheijden.insights.api.concurrent.storage.ScanHistory)1 WorldStorage (dev.frankheijden.insights.api.concurrent.storage.WorldStorage)1 AddonScanTracker (dev.frankheijden.insights.api.concurrent.tracker.AddonScanTracker)1 WorldChunkScanTracker (dev.frankheijden.insights.api.concurrent.tracker.WorldChunkScanTracker)1 MetricsManager (dev.frankheijden.insights.api.metrics.MetricsManager)1 CommandScanHistory (dev.frankheijden.insights.commands.CommandScanHistory)1 ListenerManager (dev.frankheijden.insights.listeners.manager.ListenerManager)1 EntityTrackerTask (dev.frankheijden.insights.tasks.EntityTrackerTask)1 IOException (java.io.IOException)1