pyinfra icon indicating copy to clipboard operation
pyinfra copied to clipboard

Feature request: time measurement / operation profiling

Open karolzlot opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe

I would like to measure time from pyinfra start to end of all operations. Thanks to this I could easily see speed differences for different instance types and make better decisions.

Describe the solution you'd like

It is enought if pyinfra would write: "Finished, took 11 min 35 s."

karolzlot avatar Aug 13 '21 03:08 karolzlot

Hi @karolzlot - I like this idea and would like to expand it to enable time profiling of operation calls everyhwere (time both generate + execute phases for each operation).

For a super quick way to achieve a basic timing for the entire execution, you can use the time command on nix systems and there's a powershell equivalent for Windows systems.

Fizzadar avatar Aug 22 '21 16:08 Fizzadar

Yes, I am using it like this now and it works good:

Measure-Command { pyinfra inventory.py deploy.py -vvv | Out-Default }

karolzlot avatar Aug 22 '21 17:08 karolzlot

It would be also helpful to have the current time for each line in -vvv output. I could then see how long time each command within .sh script took.

karolzlot avatar Sep 18 '21 16:09 karolzlot