co.aikar.timings.TimingsManager Java Examples

The following examples show how to use co.aikar.timings.TimingsManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LevelTimings.java    From Jupiter with GNU General Public License v3.0 6 votes vote down vote up
public LevelTimings(Level level) {
    String name = level.getFolderName() + " - ";

    this.doChunkUnload = TimingsManager.getTiming(name + "doChunkUnload");
    this.doTickPending = TimingsManager.getTiming(name + "doTickPending");
    this.doChunkGC = TimingsManager.getTiming(name + "doChunkGC");
    this.doTick = TimingsManager.getTiming(name + "doTick");

    this.tickChunks = TimingsManager.getTiming(name + "tickChunks");
    this.entityTick = TimingsManager.getTiming(name + "entityTick");
    this.blockEntityTick = TimingsManager.getTiming(name + "blockEntityTick");

    this.syncChunkSendTimer = TimingsManager.getTiming(name + "syncChunkSend");
    this.syncChunkSendPrepareTimer = TimingsManager.getTiming(name + "syncChunkSendPrepare");
    this.syncChunkLoadTimer = TimingsManager.getTiming(name + "syncChunkLoad");
    this.syncChunkLoadDataTimer = TimingsManager.getTiming(name + "syncChunkLoad - Data");
    this.syncChunkLoadEntitiesTimer = TimingsManager.getTiming(name + "syncChunkLoad - Entities");
    this.syncChunkLoadBlockEntitiesTimer = TimingsManager.getTiming(name + "syncChunkLoad - BlockEntities");
}
 
Example #2
Source File: LevelTimings.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
public LevelTimings(Level level) {
    String name = level.getFolderName() + " - ";

    this.doChunkUnload = TimingsManager.getTiming(name + "doChunkUnload");
    this.doTickPending = TimingsManager.getTiming(name + "doTickPending");
    this.doChunkGC = TimingsManager.getTiming(name + "doChunkGC");
    this.doTick = TimingsManager.getTiming(name + "doTick");

    this.tickChunks = TimingsManager.getTiming(name + "tickChunks");
    this.entityTick = TimingsManager.getTiming(name + "entityTick");
    this.blockEntityTick = TimingsManager.getTiming(name + "blockEntityTick");

    this.syncChunkSendTimer = TimingsManager.getTiming(name + "syncChunkSend");
    this.syncChunkSendPrepareTimer = TimingsManager.getTiming(name + "syncChunkSendPrepare");
    this.syncChunkLoadTimer = TimingsManager.getTiming(name + "syncChunkLoad");
    this.syncChunkLoadDataTimer = TimingsManager.getTiming(name + "syncChunkLoad - Data");
    this.syncChunkLoadEntitiesTimer = TimingsManager.getTiming(name + "syncChunkLoad - Entities");
    this.syncChunkLoadBlockEntitiesTimer = TimingsManager.getTiming(name + "syncChunkLoad - BlockEntities");
}
 
Example #3
Source File: SynapsePlayer.java    From SynapseAPI with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void handleDataPacket(DataPacket packet) {
    if (!this.isSynapseLogin) {
        super.handleDataPacket(packet);
        return;
    }
    Timing dataPacketTiming = handlePlayerDataPacketTimings.getOrDefault(packet.pid(), TimingsManager.getTiming("SynapseEntry - HandlePlayerDataPacket - " + packet.getClass().getSimpleName()));
    dataPacketTiming.startTiming();

    super.handleDataPacket(packet);

    dataPacketTiming.stopTiming();
    if (!handlePlayerDataPacketTimings.containsKey(packet.pid()))
        handlePlayerDataPacketTimings.put(packet.pid(), dataPacketTiming);

}
 
Example #4
Source File: PaperTimingsCommand.java    From LagMonitor with MIT License 6 votes vote down vote up
@Override
protected void sendTimings(CommandSender sender) {
    EvictingQueue<TimingHistory> history = Reflection.getField(TimingsManager.class, "HISTORY", EvictingQueue.class)
            .get(null);

    TimingHistory lastHistory = history.peek();
    if (lastHistory == null) {
        sendError(sender, "Not enough data collected yet");
        return;
    }

    List<BaseComponent[]> lines = new ArrayList<>();
    printTimings(lines, lastHistory);

    Pages pagination = new Pages("Paper Timings", lines);
    pagination.send(sender);

    plugin.getPageManager().setPagination(sender.getName(), pagination);
}
 
Example #5
Source File: LevelTimings.java    From Nukkit with GNU General Public License v3.0 6 votes vote down vote up
public LevelTimings(Level level) {
    String name = level.getFolderName() + " - ";

    this.doChunkUnload = TimingsManager.getTiming(name + "doChunkUnload");
    this.doTickPending = TimingsManager.getTiming(name + "doTickPending");
    this.doChunkGC = TimingsManager.getTiming(name + "doChunkGC");
    this.doTick = TimingsManager.getTiming(name + "doTick");

    this.tickChunks = TimingsManager.getTiming(name + "tickChunks");
    this.entityTick = TimingsManager.getTiming(name + "entityTick");
    this.blockEntityTick = TimingsManager.getTiming(name + "blockEntityTick");

    this.syncChunkSendTimer = TimingsManager.getTiming(name + "syncChunkSend");
    this.syncChunkSendPrepareTimer = TimingsManager.getTiming(name + "syncChunkSendPrepare");
    this.syncChunkLoadTimer = TimingsManager.getTiming(name + "syncChunkLoad");
    this.syncChunkLoadDataTimer = TimingsManager.getTiming(name + "syncChunkLoad - Data");
    this.syncChunkLoadEntitiesTimer = TimingsManager.getTiming(name + "syncChunkLoad - Entities");
    this.syncChunkLoadBlockEntitiesTimer = TimingsManager.getTiming(name + "syncChunkLoad - BlockEntities");
}
 
Example #6
Source File: PaperTimingsCommand.java    From LagMonitor with MIT License 6 votes vote down vote up
@Override
protected void sendTimings(CommandSender sender) {
    EvictingQueue<TimingHistory> history = Reflection.getField(TimingsManager.class, "HISTORY", EvictingQueue.class)
            .get(null);

    TimingHistory lastHistory = history.peek();
    if (lastHistory == null) {
        sendError(sender, "Not enough data collected yet");
        return;
    }

    List<BaseComponent[]> lines = new ArrayList<>();
    printTimings(lines, lastHistory);

    Pages pagination = new Pages("Paper Timings", lines);
    pagination.send(sender);

    plugin.getPageManager().setPagination(sender.getName(), pagination);
}