Optimization when Terra Profiler is not running

Do not set Profiler SAFE Threadlocal var when profiler is not running but ensure it is set to false after the profiler stops to ensure consistent behavior
This commit is contained in:
Zoe Gidiere 2024-10-12 00:58:08 -06:00
parent 6946755e31
commit 40ccf80c7f

View File

@ -57,7 +57,7 @@ public class ProfilerImpl implements Profiler {
Stack<Frame> stack = THREAD_STACK.get();
stack.push(new Frame(stack.isEmpty() ? frame : stack.peek().getId() + "." + frame));
} else SAFE.set(false);
} else SAFE.set(false);
}
}
@Override
@ -99,6 +99,7 @@ public class ProfilerImpl implements Profiler {
public void stop() {
logger.info("Stopping Terra profiler");
running = false;
SAFE.set(false);
}
@Override