[PUP-7520] Puppet profiling timers do not use a monotonic clock Created: 2017/05/11  Updated: 2020/03/06

Status: Accepted
Project: Puppet
Component/s: None
Affects Version/s: PUP 4.10.1
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: Charlie Sharpsteen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: jira_escalated, performance
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relates to PUP-6344 metrics.time.total does not correlate... Closed
Epic Link: Puppet Performance
Team: Froyo
Method Found: Inspection
Zendesk Ticket IDs: 38432
Zendesk Ticket Count: 1
QA Risk Assessment: Needs Assessment


Puppet has support for timing and profiling execution through the Puppet::Util::Profiler::WallClock class, used for profiling Puppet Server operations, and the Puppet::Util.thinmark method, used for measuring things like resource application. Historically these methods have measured time by calling Time.now. However, this method returns a value from the OS REALTIME clock, which can be affected by events like NTP updates. Since the puppet agent often initiates a NTP update, these jumps can create confusing profile results.

In 2.1.0, Ruby added methods to access a monotonic clock which isn't affected by things like NTP updates. We should prefer this clock for profiling timers when it is available:


Generated at Sun May 31 12:43:48 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.