-
Notifications
You must be signed in to change notification settings - Fork 38
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
WIP: Integrate a spinner to track time taken for long running operations #679 #680
base: main
Are you sure you want to change the base?
WIP: Integrate a spinner to track time taken for long running operations #679 #680
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: priyanshikhetwani The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @priyanshikhetwani! It looks like this is your first PR to ppc64le-cloud/pvsadm 🎉 |
Hi @priyanshikhetwani. Thanks for your PR. I'm waiting for a ppc64le-cloud member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
time_taken := time.Since(time.Now()).Round(time.Second) | ||
action := func() { | ||
lastMessage := "" | ||
ticker := time.NewTicker(1000 * time.Millisecond) |
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.
ticker := time.NewTicker(1000 * time.Millisecond) | |
ticker := time.NewTicker(time.Second) |
**Summary: ** Integrate a spinner to track time taken for long running operations. #679
What Happened: Multiple logs with the same message is printed on screen which is redundant by nature, a spinner can be used to achieve the objective.
I0927 03:24:02.531498 835123 import.go:258] Importing image rhel-94-04242024-tier0. Please wait...
I0927 03:24:06.596504 835123 import.go:277] Image import is in-progress, current state: queued
I0927 03:26:06.680951 835123 import.go:277] Image import is in-progress, current state: running
I0927 03:28:06.623011 835123 import.go:277] Image import is in-progress, current state: running
I0927 03:30:06.843204 835123 import.go:277] Image import is in-progress, current state: running
I0927 03:32:06.727223 835123 import.go:277] Image import is in-progress, current state: running
I0927 03:34:06.769074 835123 import.go:277] Image import is in-progress, current state: running
I0927 03:36:06.920080 835123 import.go:277] Image import is in-progress, current state: running
I0927 03:38:06.861958 835123 import.go:277] Image import is in-progress, current state: running
I0927 03:40:06.951969 835123 import.go:277] Image import is in-progress, current state: running
I0927 03:42:06.826810 835123 import.go:277] Image import is in-progress, current state: running
I0927 03:44:06.873676 835123 import.go:277] Image import is in-progress, current state: running
I0927 03:46:06.901292 835123 import.go:271] Image imported successfully, took 22m0.670579377s
Rather a spinner can be set-up lo track the current status and the time elapsed to improve user experience.
What you expected to happen:
A single line of log to track the status.
**Test: **