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

show time elapsed per resource in update #10953

Merged
merged 1 commit into from
Oct 11, 2022
Merged

Conversation

dixler
Copy link
Contributor

@dixler dixler commented Oct 6, 2022

Description

Fixes #10534

This PR modifies the display to show the time that a resource takes to update.

asciicast

Checklist

  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make changelog and committed the changelog/pending/<file> documenting my change
  • Yes, there are changes in this PR that warrants bumping the Pulumi Service API version

@pulumi-bot
Copy link
Contributor

pulumi-bot commented Oct 6, 2022

Changelog

[uncommitted] (2022-10-11)

Features

  • [cli/display] Displays time elapsed when modifying a resource.
    #10953

@dixler dixler force-pushed the dixler/10534/time-elapsed branch 3 times, most recently from 7abb9c8 to a331aa5 Compare October 6, 2022 18:54
@dixler dixler marked this pull request as ready for review October 6, 2022 19:40
pkg/backend/display/progress.go Outdated Show resolved Hide resolved
return ""
end, ok := display.opStopwatch.end[step.URN]
if !ok {
return opText
Copy link
Member

Choose a reason for hiding this comment

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

Wander if we should add a bit that the timing information was missing? It shouldn't ever be hit but if it does might prompt people to tell us about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think silently erroring is fine in this case. It could throw off the progress display to print lines in this codepath or scare the user on a warning too much.

Someone will probably report a bug that a resource's time elapsed isn't showing up when all of the others are showing up.

Copy link
Member

Choose a reason for hiding this comment

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

Yeh thinking on this more I'd be happier with a rework to make the missing times unrepresentable, but that's a minor thing we can pick up when it's convenient.

@dixler
Copy link
Contributor Author

dixler commented Oct 7, 2022

updated display as per @susanev recommendation
asciicast

@dixler dixler requested a review from Frassle October 7, 2022 20:09
if opDuration < 1 {
// Display a more fine-grain duration as the operation
// has completed.
return fmt.Sprintf("%s (%.2f secs)", opText, opDuration)
Copy link
Member

Choose a reason for hiding this comment

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

That's nice!

@dixler
Copy link
Contributor Author

dixler commented Oct 7, 2022

bors merge

bors bot added a commit that referenced this pull request Oct 7, 2022
10953: show time elapsed per resource in update r=dixler a=dixler

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Fixes #10534 

This PR modifies the display to show the time that a resource takes to update.

[![asciicast](https://asciinema.org/a/XHYWenULkugoY57kStsadcBH8.svg)](https://asciinema.org/a/XHYWenULkugoY57kStsadcBH8)

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my feature works.
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Service,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Kyle Dixler <kyle@pulumi.com>
@joeduffy
Copy link
Member

joeduffy commented Oct 7, 2022

Minor but I obsess over things like this. Instead of “10 secs” should we say “10s”? More standard abbreviation, less real estate, and more consistent with displays elsewhere (including the summary at the end of every update which is alongside this new display so easy to see them at the same time and notice the inconsistency).

@justinvp
Copy link
Member

justinvp commented Oct 7, 2022

Instead of “10 secs” should we say “10s”?

@joeduffy, see #10953 (comment). Kyle already updated the PR to do just that! 😄

@bors
Copy link
Contributor

bors bot commented Oct 7, 2022

Build failed:

@dixler
Copy link
Contributor Author

dixler commented Oct 10, 2022

bors merge

bors bot added a commit that referenced this pull request Oct 10, 2022
10953: show time elapsed per resource in update r=dixler a=dixler

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Fixes #10534 

This PR modifies the display to show the time that a resource takes to update.

[![asciicast](https://asciinema.org/a/XHYWenULkugoY57kStsadcBH8.svg)](https://asciinema.org/a/XHYWenULkugoY57kStsadcBH8)

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my feature works.
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Service,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Kyle Dixler <kyle@pulumi.com>
@bors
Copy link
Contributor

bors bot commented Oct 10, 2022

Build failed:

@dixler
Copy link
Contributor Author

dixler commented Oct 11, 2022

bors merge

bors bot added a commit that referenced this pull request Oct 11, 2022
10953: show time elapsed per resource in update r=dixler a=dixler

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Fixes #10534 

This PR modifies the display to show the time that a resource takes to update.

[![asciicast](https://asciinema.org/a/XHYWenULkugoY57kStsadcBH8.svg)](https://asciinema.org/a/XHYWenULkugoY57kStsadcBH8)

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my feature works.
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Service,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Kyle Dixler <kyle@pulumi.com>
@bors
Copy link
Contributor

bors bot commented Oct 11, 2022

Build failed:

@dixler
Copy link
Contributor Author

dixler commented Oct 11, 2022

bors merge

bors bot added a commit that referenced this pull request Oct 11, 2022
10953: show time elapsed per resource in update r=dixler a=dixler

<!--- 
Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation.
-->

# Description

<!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. -->

Fixes #10534 

This PR modifies the display to show the time that a resource takes to update.

[![asciicast](https://asciinema.org/a/XHYWenULkugoY57kStsadcBH8.svg)](https://asciinema.org/a/XHYWenULkugoY57kStsadcBH8)

## Checklist

<!--- Please provide details if the checkbox below is to be left unchecked. -->
- [ ] I have added tests that prove my fix is effective or that my feature works.
<!--- 
User-facing changes require a CHANGELOG entry.
-->
- [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change
<!--
If the change(s) in this PR is a modification of an existing call to the Pulumi Service,
then the service should honor older versions of the CLI where this change would not exist.
You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add
it to the service.
-->
- [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Service API version
  <!-- `@Pulumi` employees: If yes, you must submit corresponding changes in the service repo. -->


Co-authored-by: Kyle Dixler <kyle@pulumi.com>
@bors
Copy link
Contributor

bors bot commented Oct 11, 2022

Build failed:

@dixler
Copy link
Contributor Author

dixler commented Oct 11, 2022

bors retry

@bors
Copy link
Contributor

bors bot commented Oct 11, 2022

Build succeeded:

@bors bors bot merged commit 517e09a into master Oct 11, 2022
@bors bors bot deleted the dixler/10534/time-elapsed branch October 11, 2022 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to see resource creation times to outputs
5 participants