Interrupt the CPU collector thread on shutdown
Otherwise we have to wait up to 200ms for the sleep to return, which can
significantly affect bazel invocation times for fast-running invocations
(e.g., bazel query).
@@ -56,6 +56,7 @@ public class CollectLocalCpuUsage extends Thread {
public void stopCollecting() {
Preconditions.checkArgument(!stopCpuUsage);
stopCpuUsage = true;
+ interrupt();
}
public void logCollectedData() {
