Shaves about half a second off of a regular kubectl cost namespace query and provides big time savings for multi-workload predictions. These savings should be linear with # of predictions because this avoids re-forwarding for every workload prediction.
How does this PR impact users? (This is the kind of thing that goes in release notes!)
Improved performance for multiple port-forwarded queries by maintaining a single port-forward session rather than re-forwarding for each query.
How was this PR tested?
Locally with kubectl cost predict and kubectl cost namespace, observing improved perf in both cases but particularly in predict due to its multi-query nature.
What does this PR change?
Shaves about half a second off of a regular kubectl cost namespace query and provides big time savings for multi-workload predictions. These savings should be linear with # of predictions because this avoids re-forwarding for every workload prediction.
How does this PR impact users? (This is the kind of thing that goes in release notes!)
How was this PR tested?
Locally with
kubectl cost predict
andkubectl cost namespace
, observing improved perf in both cases but particularly inpredict
due to its multi-query nature.Also checked to make sure ports aren't being leaked after the run with
ss -peanut
. Saw ports sticking around for a little while. Learned about TCPTIME_WAIT
via https://unix.stackexchange.com/questions/68311/why-does-it-take-up-to-several-minutes-to-clean-a-listening-tcp-port-after-a-pro. The port is indeed released after a brief time.Have you made an update to documentation?
Yes, the README update in this PR.