kube-profefe
kube-profefe copied to clipboard
Make the parallelization factor dynamic
At the moment the number of goroutines kprofefe spin up is fixed to 10. We can do better.
First, we should look at GOMAXPROCS
has to a limit. No more goroutines that what it specifies.
The GOMAXPROCS variable limits the number of operating system threads that can execute user-level Go code simultaneously. There is no limit to the number of threads that can be blocked in system calls on behalf of Go code; those do not count against the GOMAXPROCS limit. This package's GOMAXPROCS function queries and changes the limit.
In second based on the number of pods to gather, we can calculate the right number of goroutines.