-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Batch logs output to speedup minikube logs
command
#11274
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beautiful ! lets add integration test for it, so we never break this agian,
no user should ever have to wait for Text file more than 5 seconds to be shown up
Can one of the admins verify this patch? |
/ok-to-test |
kvm2 driver with docker runtime
Times for minikube ingress: 34.3s 35.3s 34.8s 35.3s 36.9s Times for minikube start: 55.6s 52.8s 50.6s 47.7s 48.4s docker driver with docker runtime
Times for minikube ingress: 35.0s 33.5s 32.5s 35.0s 34.0s Times for minikube start: 22.4s 21.3s 21.3s 20.8s 21.6s docker driver with containerd runtime
Times for minikube start: 43.5s 47.0s 43.6s 42.8s 46.8s |
kvm2 driver with docker runtime
Times for minikube start: 51.2s 47.0s 55.4s 55.5s 49.5s Times for minikube ingress: 34.7s 35.3s 35.4s 36.9s 35.8s docker driver with docker runtime
Times for minikube start: 23.6s 23.2s 22.6s 22.3s 21.9s Times for minikube ingress: 33.5s 37.0s 31.6s 33.6s 37.5s docker driver with containerd runtime
Times for minikube start: 48.4s 43.1s 47.2s 47.1s 43.6s |
defer cancel() | ||
args := []string{"logs", "-p", profile} | ||
if _, err := Run(t, exec.CommandContext(ctx, Target(), args...)); err != nil { | ||
t.Errorf("minikube logs failed with error: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can ignore minikube logs error here...just care about the duration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't ignore error or linting fails, I replaced with a t.Logf
so it won't fail the test.
kvm2 driver with docker runtime
Times for minikube start: 53.4s 52.1s 55.9s 49.4s 55.2s Times for minikube ingress: 41.3s 37.2s 34.7s 35.3s 34.8s docker driver with docker runtime
Times for minikube start: 22.2s 22.3s 21.7s 20.8s 21.5s Times for minikube ingress: 32.5s 34.5s 33.0s 30.5s 27.5s docker driver with containerd runtime
Times for minikube start: 31.1s 46.7s 46.9s 43.1s 42.7s |
kvm2 driver with docker runtime
Times for minikube ingress: 33.8s 35.9s 37.4s 35.2s 33.7s Times for minikube (PR 11274) start: 47.9s 47.8s 46.9s 55.8s 51.3s docker driver with docker runtime
Times for minikube ingress: 31.0s 32.0s 26.5s 30.0s 35.0s Times for minikube start: 21.7s 21.5s 22.8s 21.1s 20.9s docker driver with containerd runtime
Times for minikube start: 43.5s 42.3s 47.5s 43.4s 43.2s |
I can confirm this PR results in a 9.2X speed up in |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: medyagh, spowelljr The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Closes #11266
Currently each line of logs calls
out.Styled
,out.Styled
callsklog.Flush
, so flushing on many lines repeatedly slows down the output.The PR batches large amounts of lines into a single string before calling
out.Styled
, greatly reducing the output time.Before:
After: