| The agent calculates 3 types of metrics and submits them in the report. One of types is "Time" and it captures how long different parts of the agent run take, for example, how long pluginsync took, how long each resource type took to apply, etc. This can be seen using puppet agent -t --summarize:
Time: |
Schedule: 0.00 |
Notify: 0.00 |
File: 0.01 |
Config retrieval: 0.32 |
Node retrieval: 0.34 |
Convert catalog: 0.36 |
Plugin sync: 0.56 |
Startup time: 0.96 |
Transaction evaluation: 1.97 |
Catalog application: 1.98 |
Last run: 1590168479 |
Fact generation: 2.57 |
Filebucket: 0.00 |
Pe anchor: 0.00 |
Total: 7.11
|
I think the only place we document this is in the report code: https://github.com/puppetlabs/puppet/blob/58c02cceda56025623ad5bc227579a9aaeddfc80/lib/puppet/transaction/report.rb#L16-L24 It would be good to document what the different phases are and how they relate. For example, the "Total" time includes "Node retrieval", "Plugin sync", etc. We also added more time metrics but didn't update the report description. The current list of time metrics is:
lib/puppet/configurer.rb: options[:report].add_times(:convert_catalog, catalog_conversion_time) if options[:report] |
lib/puppet/configurer.rb: options[:report].add_times(:plugin_sync, plugin_sync_time) if options[:report] |
lib/puppet/configurer.rb: options[:report].add_times(:fact_generation, facter_time) if options[:report] |
lib/puppet/configurer.rb: options[:report].add_times(:catalog_application, apply_catalog_time) |
lib/puppet/configurer.rb: report.add_times(:startup_time, startup_time) |
lib/puppet/configurer.rb: options[:report].add_times(:node_retrieval, node_retr_time) |
lib/puppet/configurer.rb: report.add_times(:resubmit_facts, resubmit_facts_time) |
lib/puppet/configurer.rb: report.add_times(:total, Time.now - report.time) |
lib/puppet/resource/catalog.rb: transaction.report.add_times(:transaction_evaluation, transaction_evaluate_time) |
lib/puppet/transaction.rb: @report.add_times(:config_retrieval, @catalog.retrieval_duration || 0)
|
Plus there are times for each type of resource, e.g. File is the time to apply all file resources. |