Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

priyanshikhetwani
Copy link

**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: **
Screenshot 2024-10-04 at 10 17 56 AM

@ppc64le-cloud-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: priyanshikhetwani
Once this PR has been reviewed and has the lgtm label, please assign mkumatag for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ppc64le-cloud-bot
Copy link
Contributor

Welcome @priyanshikhetwani! It looks like this is your first PR to ppc64le-cloud/pvsadm 🎉

@ppc64le-cloud-bot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@ppc64le-cloud-bot ppc64le-cloud-bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 4, 2024
time_taken := time.Since(time.Now()).Round(time.Second)
action := func() {
lastMessage := ""
ticker := time.NewTicker(1000 * time.Millisecond)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ticker := time.NewTicker(1000 * time.Millisecond)
ticker := time.NewTicker(time.Second)

@priyanshikhetwani priyanshikhetwani changed the title Integrate a spinner to track time taken for long running operations #679 WIP: Integrate a spinner to track time taken for long running operations #679 Oct 4, 2024
@ppc64le-cloud-bot ppc64le-cloud-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants