Class BenchmarkManager

java.lang.Object
net.minestom.server.benchmark.BenchmarkManager

public final class BenchmarkManager
extends java.lang.Object
Small monitoring tools that can be used to check the current memory usage and Minestom threads CPU usage.

Needs to be enabled with enable(UpdateOption). Memory can then be accessed with getUsedMemory() and the CPUs usage with getResultMap() or getCpuMonitoringMessage().

Be aware that this is not the most accurate method, you should use a proper java profiler depending on your needs.

  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.management.ThreadMXBean THREAD_MX_BEAN  
  • Constructor Summary

    Constructors 
    Constructor Description
    BenchmarkManager()  
  • Method Summary

    Modifier and Type Method Description
    void addThreadMonitor​(java.lang.String threadName)  
    void disable()  
    void enable​(UpdateOption updateOption)  
    java.lang.String getCpuMonitoringMessage()  
    java.util.Map<java.lang.String,​ThreadResult> getResultMap()  
    long getUsedMemory()
    Gets the heap memory used by the server in bytes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait