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

(CLI): show the time it takes for cdk deploy (including when running cdk watch) to finish #18213

Closed
2 tasks
skinny85 opened this issue Dec 29, 2021 · 4 comments · Fixed by #18230
Closed
2 tasks
Assignees
Labels
effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 package/tools Related to AWS CDK Tools or CLI

Comments

@skinny85
Copy link
Contributor

Description

Let's print out the total time it takes for cdk deploy to finish, including when a deployment happens through cdk watch.

This will allows us to brag more easily about how quickly hotswapping works 😃.

Use Case

Showing the speedup hotswap deployments offer.

Proposed Solution

Print out the time it takes for deployment to finish in the CDK CLI.

Other information

Print out the total time

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@skinny85 skinny85 added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Dec 29, 2021
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Dec 29, 2021
@kaizencc
Copy link
Contributor

I actually feel like this is reinventing the wheel a little bit, specifically for cdk deploy. We can easily call yarn cdk deploy or time cdk deploy to get the same functionality. The only time where we can't do this is for cdk watch, since it's not one-shot.

I thought we might just do this for cdk watch only and add a time stamp wrapper around this:

await this.invokeDeployFromWatch(options);

Happy to do it for cdk deploy if you feel otherwise but I feel like the use case is only for cdk watch.

@kaizencc kaizencc added effort/small Small work item – less than a day of effort p2 and removed needs-triage This issue or PR still needs to be triaged. labels Dec 29, 2021
@kaizencc kaizencc assigned kaizencc and unassigned rix0rrr Dec 29, 2021
@skinny85
Copy link
Contributor Author

skinny85 commented Dec 29, 2021

I agree it's not great if we simply write out the total time. So why don't we spice things up a little bit? 😃

What if we divided the different phases of deploy, and printed out the time for each of them? For example, the time to synth the Cloud Assembly immediately jumps out to me as being interesting.

So, the output would be something like:

$ cdk deploy MyExampleStack
Stack MyExampleStack
...

✨  Synthesis time: 3.54s
...

✨  Deployment time: 4.56s
...

✨  Total time: 8.1s
...

Thoughts on this idea?

@misterjoshua
Copy link
Contributor

misterjoshua commented Dec 29, 2021

In this vein: I'd appreciate a performance tracing mode for synthesis because I find it difficult to tell which parts of my cdk app (probably bundling assets, but which?) are slowing my synth down.

@mergify mergify bot closed this as completed in #18230 Jan 4, 2022
mergify bot pushed a commit that referenced this issue Jan 4, 2022
Keeps track of how long `cdk deploy` steps take. Times synthesis time along with actual deploy time.

Result is something like this:

![Screen Shot 2021-12-30 at 2 32 24 PM](https://user-images.githubusercontent.com/36202692/147782736-bc68d41f-4a9a-4cc9-b623-b7a27e44c10e.png)

No tests because all I'm adding is print statements.
Closes #18213.
 
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

github-actions bot commented Jan 4, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Feb 21, 2022
Keeps track of how long `cdk deploy` steps take. Times synthesis time along with actual deploy time.

Result is something like this:

![Screen Shot 2021-12-30 at 2 32 24 PM](https://user-images.githubusercontent.com/36202692/147782736-bc68d41f-4a9a-4cc9-b623-b7a27e44c10e.png)

No tests because all I'm adding is print statements.
Closes aws#18213.
 
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants