mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Prevent getting the cpu monitoring message if the benchmark manager is not enabled
This commit is contained in:
parent
df4dd762d9
commit
edf22fcb66
@ -99,11 +99,14 @@ public final class BenchmarkManager {
|
||||
return Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Map<String, ThreadResult> getResultMap() {
|
||||
return Collections.unmodifiableMap(resultMap);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getCpuMonitoringMessage() {
|
||||
Check.stateCondition(!enabled, "CPU monitoring is only possible when the benchmark manager is enabled.");
|
||||
String benchmarkMessage = "";
|
||||
for (Map.Entry<String, ThreadResult> resultEntry : resultMap.entrySet()) {
|
||||
final String name = resultEntry.getKey();
|
||||
|
Loading…
Reference in New Issue
Block a user