Summary
Provide built-in profiling and timing for pyinfra deploys so users can see how long each operation takes and identify bottlenecks.
Motivation
Wrapping the whole run with time gives a single overall number, which is not enough to understand where time is spent. Per-operation timing would help users:
- Compare deploy speed across instance types and connectors.
- Identify slow operations or facts.
- Diagnose regressions after upgrades.
Proposed scope
- Time both phases of every operation: prepare/generate and execute.
- Time fact gathering per host and per fact.
- Print a final summary at the end of the run, similar to
Finished, took 11 min 35 s, plus a breakdown of the slowest operations and facts.
- Optionally include timestamps on each
-vvv log line so users can correlate timings with individual commands.
- Expose timing data programmatically via the API or as a structured output (JSON) so it can be consumed by external tooling.
References
Consolidates and supersedes:
Summary
Provide built-in profiling and timing for pyinfra deploys so users can see how long each operation takes and identify bottlenecks.
Motivation
Wrapping the whole run with
timegives a single overall number, which is not enough to understand where time is spent. Per-operation timing would help users:Proposed scope
Finished, took 11 min 35 s, plus a breakdown of the slowest operations and facts.-vvvlog line so users can correlate timings with individual commands.References
Consolidates and supersedes: