perfectsense / gyro

Gyro is a command-line tool for creating, updating, and maintaining cloud infrastructure. Gyro makes infrastructure-as-code possible.
https://gyro.dev
Apache License 2.0
134 stars 7 forks source link

Display elapsed time during execution #369

Closed beetlebugorg closed 3 years ago

beetlebugorg commented 3 years ago

This PR improves the output of Gyro by adding elapsed time to the execution output. Users will now see how long it took to create, update, delete, and refresh resources. The following will be appended to after each execution (elapsed time: 0m32s) OK

$ gyro up accelerator.gyro 
Refreshing aws::route53-record-set::qa cloudfront-static-cache took: 1106ms
Refreshing aws::route53-record-set::qa cloudfront-content-cache took: 1107ms
<snip>
⟳ Refreshed resources: 61

Looking for changes...

- Delete aws::global-accelerator accelerator-qa (arn:aws:globalaccelerator::640415027344:accelerator/4d3d8089-fd95-4096-bb52-0ae44c2b89d5)
    - Delete attributes
    - Delete ip-sets 75.2.13.245, 99.83.162.33

- Delete aws::global-accelerator-listener accelerator-qa (arn:aws:globalaccelerator::640415027344:accelerator/4d3d8089-fd95-4096-bb52-0ae44c2b89d5/listener/667623d6)
    - Delete port-range 80:80
    - Delete port-range 443:443
    - Delete port-range 8443:8443

- Delete aws::global-accelerator-endpoint-group accelerator-qa (arn:aws:globalaccelerator::640415027344:accelerator/4d3d8089-fd95-4096-bb52-0ae44c2b89d5/listener/667623d6/endpoint-group/f1563b651002)
    - Delete endpoint-configuration arn:aws:elasticloadbalancing:us-east-1:640415027344:loadbalancer/app/brightspot-cloud-k12-qa/c8580f9d493ea86f

Are you sure you want to change resources? (y/N) y

- Deleting aws::global-accelerator-endpoint-group accelerator-qa (arn:aws:globalaccelerator::640415027344:accelerator/4d3d8089-fd95-4096-bb52-0ae44c2b89d5/listener/667623d6/endpoint-group/f1563b651002) (elapsed time: 810ms)  OK
- Deleting aws::global-accelerator-listener accelerator-qa (arn:aws:globalaccelerator::640415027344:accelerator/4d3d8089-fd95-4096-bb52-0ae44c2b89d5/listener/667623d6) (elapsed time: 149ms)  OK
- Deleting aws::global-accelerator accelerator-qa (arn:aws:globalaccelerator::640415027344:accelerator/4d3d8089-fd95-4096-bb52-0ae44c2b89d5) (elapsed time: 0m32s)  OK