Prevent getting the cpu monitoring message if the benchmark manager is not enabled

This commit is contained in:
Felix Cravic 2020-11-25 11:39:36 +01:00
parent df4dd762d9
commit edf22fcb66

View File

@ -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();