Convert `threadCPUDelta` values into `cpuRatio`s in the Thread process pipeline with strong types
From Markus' review here: https://github.com/firefox-devtools/profiler/pull/4067#pullrequestreview-993791688
Option 4 would take the maxThreadCPUDeltaPerMs into account when computing the thread's processed threadCPUDelta, and compute a cpuRatio per sample. Now activity graph drawing wouldn't even need to know the maxThreadCPUDeltaPerMs, and it can directly get the cpuRatio values from the derived thread.
and
I think option 3 is a bit of an in-between state. I think I would prefer option 2 or option 4. But if we take option 4, I'd like to go all the way and have strong types. This would mean that, instead of reusing the
Threadtype, we'd have aDerivedThreadtype with acpuRatiofield instead of athreadCPUDeltafield. It would be a fairly invasive change because theThreadtype is used in many places. But having aDerivedThread(orFilteredThread) type would have other advantages too, for example it would make it easier to share a stringTable or a stackTable between threads, see the end of this comment: #3919 (comment)
Currently #4067 implements the Option 2, which is less invasive. But it would be good to do this change and implement Option 4.