Ensures that on profile load, no threads are filtered out i.e. initialVisibleThreads contains all threads, and that the thread in which the profiler was started is the pre-selected thread i.e. it's the one and only thread in initialSelectedThreads.
Manual testing
```ruby
# main thread start
Vernier.profile(out: "output_main.json") do
10.times.map do |i|
Thread.new do
Thread.current.name = "Spawned #{i}"
sleep 0.01
end
end.each(&:join)
end
# spawned thread start
10.times.map do |i|
Thread.new do
if i == 5
Vernier.profile(out: "output_spawned.json") do
Thread.current.name = "Spawned #{i}"
sleep 0.01
end
else
Thread.current.name = "Spawned #{i}"
sleep 0.01
end
end
end.each(&:join)
```
[output_main.json](https://github.com/user-attachments/files/16038921/output_main.json)
[output_spawned.json](https://github.com/user-attachments/files/16038923/output_spawned.json)
Closes https://github.com/jhawthorn/vernier/issues/56 Related to https://github.com/jhawthorn/vernier/pull/75
Ensures that on profile load, no threads are filtered out i.e.
initialVisibleThreads
contains all threads, and that the thread in which the profiler was started is the pre-selected thread i.e. it's the one and only thread ininitialSelectedThreads
.Manual testing
```ruby # main thread start Vernier.profile(out: "output_main.json") do 10.times.map do |i| Thread.new do Thread.current.name = "Spawned #{i}" sleep 0.01 end end.each(&:join) end # spawned thread start 10.times.map do |i| Thread.new do if i == 5 Vernier.profile(out: "output_spawned.json") do Thread.current.name = "Spawned #{i}" sleep 0.01 end else Thread.current.name = "Spawned #{i}" sleep 0.01 end end end.each(&:join) ``` [output_main.json](https://github.com/user-attachments/files/16038921/output_main.json) [output_spawned.json](https://github.com/user-attachments/files/16038923/output_spawned.json)