Jira (FACT-1380) Restore --timing option to native facter

22 views
Skip to first unread message

Greg Larkin (JIRA)

unread,
Mar 30, 2016, 7:18:04 PM3/30/16
to puppe...@googlegroups.com
Greg Larkin created an issue
 
Facter / Improvement FACT-1380
Restore --timing option to native facter
Issue Type: Improvement Improvement
Assignee: Unassigned
Created: 2016/03/30 4:17 PM
Priority: Normal Normal
Reporter: Greg Larkin

A PSE in the field reports that running native Facter on Windows spikes the CPU for a few seconds on each run. The --timing option previously available in facter is no longer present in native facter, making it difficult to determine where the problem is.

Restoring the --timing option would make it easier to debug this problem.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.13#64028-sha1:b7939e9)
Atlassian logo

Maggie Dreyer (JIRA)

unread,
May 17, 2017, 2:29:02 PM5/17/17
to puppe...@googlegroups.com
Maggie Dreyer updated an issue
Change By: Maggie Dreyer
Labels: triaged
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Moses Mendoza (JIRA)

unread,
May 18, 2017, 1:46:07 PM5/18/17
to puppe...@googlegroups.com

Owen Rodabaugh (JIRA)

unread,
Dec 12, 2017, 11:44:03 AM12/12/17
to puppe...@googlegroups.com
Owen Rodabaugh updated an issue
Change By: Owen Rodabaugh
CS Priority: Normal
CS Impact: This was a very useful option to debug long running facts. Good debugging helps you solve issues faster.
CS Severity: 3 - Serious
CS Business Value: 3 - $$$$
CS Frequency: 2 - 5-25% of Customers
This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

Sean McDonald (JIRA)

unread,
Feb 21, 2018, 1:58:03 PM2/21/18
to puppe...@googlegroups.com
Sean McDonald updated an issue
Change By: Sean McDonald
Labels: triaged windows
This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)
Atlassian logo

Dylan Ratcliffe (JIRA)

unread,
Aug 10, 2018, 4:55:03 AM8/10/18
to puppe...@googlegroups.com
Dylan Ratcliffe commented on Improvement FACT-1380
 
Re: Restore --timing option to native facter

What information does this need? It would be super helpful to have this option back. To be clean this is not a Windows issue, it's just a feature that didn't survive the refactor to C (pun intended)

This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Paul Anderson (JIRA)

unread,
Sep 6, 2018, 1:24:05 PM9/6/18
to puppe...@googlegroups.com

This came up for a user I was speaking with today.

Paul Anderson (JIRA)

unread,
Sep 6, 2018, 1:29:05 PM9/6/18
to puppe...@googlegroups.com

Robert Petersson Can you tell us what further information you're looking for?

Jeremy Adams (JIRA)

unread,
Sep 6, 2018, 1:35:03 PM9/6/18
to puppe...@googlegroups.com

Paul Anderson (JIRA)

unread,
Sep 6, 2018, 1:39:04 PM9/6/18
to puppe...@googlegroups.com
Paul Anderson updated an issue
 
Change By: Paul Anderson
Labels: PS linux regression windows

Paul Anderson (JIRA)

unread,
Sep 6, 2018, 2:07:03 PM9/6/18
to puppe...@googlegroups.com
Paul Anderson commented on Improvement FACT-1380
 
Re: Restore --timing option to native facter

I came up with a quick and dirty bash one-liner that is neither elegant nor guaranteed accurate, but was enough to help the user get a rough order of magnitude read on each of their facts.

for fact in `facter -p | egrep '^\w+\s=>' | cut -f 1 -d "="`; do echo $fact; time /usr/local/bin/facter -p $fact > /dev/null; done

Adrian Parreiras Horta (JIRA)

unread,
Sep 6, 2018, 3:49:04 PM9/6/18
to puppe...@googlegroups.com

A hack using `jq` to get a list of the facts and time each one. One could probably substitute Python's json tool or something else.

#!/bin/bash                                                                                                                                                       
                                                                                                                                                                  
shopt -s nullglob                                                                                                                                                 
facts=($(facter -p --json | jq -cr 'keys | .[]'))                                                                                                                 
                                                                                                                                                                  
for f in "${facts[@]}"; do                                                                                                                                        
   echo "${f}:"                                                                                                                                                   
   time facter -p "$f" &>/dev/null                                                                                                                                
done                                                                                                                                                             

 

 

Mihai Buzgau (Jira)

unread,
Aug 11, 2020, 5:14:02 AM8/11/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
 
Change By: Mihai Buzgau
Labels: PS linux platform_7 regression windows
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Mihai Buzgau (Jira)

unread,
Aug 11, 2020, 6:54:03 AM8/11/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sub-team: ghost

Mihai Buzgau (Jira)

unread,
Aug 11, 2020, 6:54:03 AM8/11/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Team: Platform OS Night's Watch

Mihai Buzgau (Jira)

unread,
Aug 11, 2020, 8:24:05 AM8/11/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: ready for triage

Bogdan Irimie (Jira)

unread,
Aug 19, 2020, 9:58:04 AM8/19/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ready for triage ghost-26.08

Bogdan Irimie (Jira)

unread,
Aug 19, 2020, 9:59:04 AM8/19/20
to puppe...@googlegroups.com

Bogdan Irimie (Jira)

unread,
Aug 26, 2020, 9:04:04 AM8/26/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-26.08 , ready for triage 2

Bogdan Irimie (Jira)

unread,
Sep 1, 2020, 5:23:04 AM9/1/20
to puppe...@googlegroups.com
Bogdan Irimie assigned an issue to Bogdan Irimie
Change By: Bogdan Irimie
Assignee: Bogdan Irimie

Bogdan Irimie (Jira)

unread,
Sep 2, 2020, 9:07:03 AM9/2/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost-26.08, ghost-2.09 , ready for triage 2

Bogdan Irimie (Jira)

unread,
Sep 2, 2020, 11:26:04 AM9/2/20
to puppe...@googlegroups.com
Bogdan Irimie commented on Improvement FACT-1380
 
Re: Restore --timing option to native facter

Added the `--timing` and `-t` arguments in Facter 4. The option displays how much time it took to resolve each fact, for all fact types (core, custom and external).

Output example:

fact `my_external_fact_script.sh`, took: (0.008115) seconds
fact `memory.swap.total`, took: (0.003790) seconds
fact `memory.swap.available`, took: (0.000020) seconds
fact `memory.swap.encrypted`, took: (0.000008) seconds
fact `memory.swap.used`, took: (0.000010) seconds
fact `memory.swap.total_bytes`, took: (0.000022) seconds
fact `memory.swap.capacity`, took: (0.000006) seconds
fact `memory.swap.used_bytes`, took: (0.000006) seconds
fact `memory.swap.available_bytes`, took: (0.000008) seconds
fact `memory.system.total`, took: (0.007215) seconds
fact `memory.system.available`, took: (0.000022) seconds
fact `memory.system.used`, took: (0.000013) seconds
fact `memory.system.total_bytes`, took: (0.000013) seconds
fact `memory.system.capacity`, took: (0.000006) seconds
fact `memory.system.used_bytes`, took: (0.000007) seconds
fact `memory.system.available_bytes`, took: (0.000008) seconds
fact `aio_agent_version`, took: (0.000050) seconds
fact `ruby.version`, took: (0.000020) seconds
fact `ruby.platform`, took: (0.000006) seconds
fact `ruby.sitedir`, took: (0.000007) seconds
fact `path`, took: (0.000022) seconds
fact `interfaces`, took: (0.036489) seconds
fact `macaddress_.*`, took: (0.000029) seconds
fact `network_.*`, took: (0.000013) seconds
fact `netmask_.*`, took: (0.000012) seconds
fact `scope6_.*`, took: (0.000012) seconds
fact `facterversion`, took: (0.000016) seconds
fact `load_averages`, took: (0.003865) seconds
fact `networking.mac`, took: (0.000025) seconds
fact `networking.network6`, took: (0.000012) seconds
fact `networking.primary`, took: (0.000009) seconds
fact `networking.ip`, took: (0.000006) seconds
fact `networking.mtu`, took: (0.000008) seconds
fact `networking.network`, took: (0.000011) seconds
fact `networking.ip6`, took: (0.000007) seconds
fact `networking.scope6`, took: (0.000006) seconds
fact `networking.netmask6`, took: (0.000007) seconds
fact `networking.hostname`, took: (0.003773) seconds
fact `networking.netmask`, took: (0.000025) seconds
fact `networking.domain`, took: (0.000010) seconds
fact `networking.interfaces`, took: (0.000238) seconds
fact `networking.fqdn`, took: (0.000010) seconds
fact `networking.dhcp`, took: (0.000009) seconds
fact `timezone`, took: (0.000045) seconds
fact `network6_.*`, took: (0.000018) seconds
fact `system_uptime.uptime`, took: (0.007580) seconds
fact `system_uptime.seconds`, took: (0.000019) seconds
fact `system_uptime.days`, took: (0.000010) seconds
fact `system_uptime.hours`, took: (0.000008) seconds
fact `puppetversion`, took: (0.000778) seconds
fact `dhcp_servers`, took: (0.000030) seconds
fact `netmask6_.*`, took: (0.000107) seconds
fact `os.release`, took: (0.018080) seconds
fact `os.name`, took: (0.000021) seconds
fact `os.hardware`, took: (0.000118) seconds
fact `os.architecture`, took: (0.000009) seconds
fact `os.family`, took: (0.000008) seconds
fact `os.macosx.version`, took: (0.012263) seconds
fact `os.macosx.build`, took: (0.000018) seconds
fact `os.macosx.product`, took: (0.000010) seconds
fact `kernel`, took: (0.000016) seconds
fact `is_virtual`, took: (0.361215) seconds
fact `kernelversion`, took: (0.000026) seconds
fact `kernelrelease`, took: (0.000009) seconds
fact `augeas.version`, took: (0.009890) seconds
fact `mtu_.*`, took: (0.000040) seconds
fact `ipaddress6_.*`, took: (0.000019) seconds
fact `kernelmajversion`, took: (0.000018) seconds
fact `dmi.product.name`, took: (0.003448) seconds
fact `sshfp_.*`, took: (0.000209) seconds
fact `mountpoints`, took: (0.025567) seconds
fact `ssh.*key`, took: (0.000009) seconds
fact `virtual`, took: (0.131998) seconds
fact `processors.speed`, took: (0.004508) seconds
fact `processors.models`, took: (0.000039) seconds
fact `processors.count`, took: (0.000011) seconds
fact `processors.isa`, took: (0.000014) seconds
fact `processors.physicalcount`, took: (0.000006) seconds
fact `system_profiler.processor_name`, took: (0.000010) seconds
fact `system_profiler.memory`, took: (0.000010) seconds
fact `system_profiler.hardware_uuid`, took: (0.000010) seconds
fact `system_profiler.uptime`, took: (0.124789) seconds
fact `system_profiler.model_name`, took: (0.000022) seconds
fact `system_profiler.cores`, took: (0.000011) seconds
fact `system_profiler.boot_volume`, took: (0.000009) seconds
fact `system_profiler.username`, took: (0.000009) seconds
fact `system_profiler.secure_virtual_memory`, took: (0.000008) seconds
fact `system_profiler.processor_speed`, took: (0.000009) seconds
fact `system_profiler.model_identifier`, took: (0.000010) seconds
fact `system_profiler.kernel_version`, took: (0.000009) seconds
fact `system_profiler.boot_mode`, took: (0.000007) seconds
fact `system_profiler.processors`, took: (0.000013) seconds
fact `system_profiler.l2_cache_per_core`, took: (0.000009) seconds
fact `system_profiler.boot_rom_version`, took: (0.000008) seconds
fact `system_profiler.system_version`, took: (0.000006) seconds
fact `system_profiler.smc_version`, took: (0.166294) seconds
fact `system_profiler.l3_cache`, took: (0.000025) seconds
fact `system_profiler.computer_name`, took: (0.000015) seconds
fact `system_profiler.serial_number`, took: (0.000014) seconds
fact `filesystems`, took: (0.004767) seconds
fact `identity.group`, took: (0.004048) seconds
fact `identity.uid`, took: (0.000013) seconds
fact `identity.privileged`, took: (0.000006) seconds
fact `identity.gid`, took: (0.000008) seconds
fact `identity.user`, took: (0.000009) seconds
fact `ssh`, took: (0.000016) seconds
fact `ipaddress_.*`, took: (0.000020) seconds
fact `oss`, took: (0.000062) seconds
fact `os.release`, took: (0.000019) seconds
fact `os.name`, took: (0.000005) seconds
fact `os.hardware`, took: (0.000005) seconds
fact `os.architecture`, took: (0.000005) seconds
fact `os.family`, took: (0.000005) seconds
fact `os.macosx.version`, took: (0.000010) seconds
fact `os.macosx.build`, took: (0.000005) seconds
fact `os.macosx.product`, took: (0.000004) seconds
fact `my_custom_fact`, took: (0.019194) seconds
fact `my_external_fact`, took: (0.000014) seconds

For external facts, we print the time it took to execute the script that provided these facts e.g. `my_external_fact_script.sh`

Bogdan Irimie (Jira)

unread,
Nov 5, 2020, 9:19:03 AM11/5/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Release Notes: Not Needed New Feature
Release Notes Summary: Added `--timing` and `-t` arguments. They allow users to see how much time each fact took to get resolved.
e.g.

fact 'path', took: (0.000064) seconds
fact 'puppetversion', took: (0.000879) seconds
fact 'processors.models', took: (0.042051) seconds
fact 'os.macosx.product', took: (0.038208) seconds

The timing is on a very granular level, each fact in the hierarchy is benchmarked individually e.g.
fact 'os.macosx.version', took: (0.037310) seconds
fact 'os.macosx.product', took: (0.038208) seconds
fact 'os.macosx.build', took: (0.038743) seconds

Mihai Buzgau (Jira)

unread,
Nov 5, 2020, 9:39:03 AM11/5/20
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Fix Version/s: FACT 4.0.45

Claire Cadman (Jira)

unread,
Nov 10, 2020, 5:58:02 AM11/10/20
to puppe...@googlegroups.com
Claire Cadman updated an issue
Change By: Claire Cadman
Labels: PS doc_reviewed linux platform_7 regression windows
Reply all
Reply to author
Forward
0 new messages