Jira (PUP-7520) Puppet profiling timers do not use a monotonic clock

15 views
Skip to first unread message

Charlie Sharpsteen (JIRA)

unread,
May 11, 2017, 12:18:02 PM5/11/17
to puppe...@googlegroups.com
Charlie Sharpsteen updated an issue
 
Puppet / Bug PUP-7520
Puppet profiling timers do not use a monotonic clock
Change By: Charlie Sharpsteen
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  thinks  events  like NTP updates. Since the puppet agent often initiates a NTP update, these jumps can create confusing profile resullts.

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:

https://ruby-doc.org/core-2.1.0/Process.html
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Charlie Sharpsteen (JIRA)

unread,
May 11, 2017, 12:18:02 PM5/11/17
to puppe...@googlegroups.com
Charlie Sharpsteen created an issue
Issue Type: Bug Bug
Affects Versions: PUP 4.10.1
Assignee: Unassigned
Created: 2017/05/11 9:17 AM
Priority: Normal Normal
Reporter: Charlie Sharpsteen

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 thinks like NTP updates. Since the puppet agent often initiates a NTP update, these jumps can create confusing profile resullts.

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:

https://ruby-doc.org/core-2.1.0/Process.html

Charlie Sharpsteen (JIRA)

unread,
May 11, 2017, 12:19:02 PM5/11/17
to puppe...@googlegroups.com
Charlie Sharpsteen updated an issue
Change By: Charlie Sharpsteen
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  resullts  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:

https://ruby-doc.org/core-2.1.0/Process.html

Josh Cooper (JIRA)

unread,
May 16, 2017, 7:22:03 PM5/16/17
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Labels: performance triaged

Charlie Sharpsteen (JIRA)

unread,
Jun 23, 2017, 7:30:02 PM6/23/17
to puppe...@googlegroups.com

Austin Boyd (Jira)

unread,
Mar 6, 2020, 12:58:03 PM3/6/20
to puppe...@googlegroups.com
Austin Boyd updated an issue
Change By: Austin Boyd
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 38432
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Austin Boyd (Jira)

unread,
Mar 6, 2020, 12:58:03 PM3/6/20
to puppe...@googlegroups.com
Austin Boyd updated an issue
Change By: Austin Boyd
Labels: jira_escalated performance

David McTavish (Jira)

unread,
Dec 6, 2021, 1:00:03 PM12/6/21
to puppe...@googlegroups.com
David McTavish updated an issue
Change By: David McTavish
Labels: final_triage jira_escalated nice-to-have performance
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

David McTavish (Jira)

unread,
Dec 6, 2021, 1:45:01 PM12/6/21
to puppe...@googlegroups.com

Charlie Sharpsteen (Jira)

unread,
Dec 28, 2021, 11:20:03 AM12/28/21
to puppe...@googlegroups.com
Charlie Sharpsteen commented on Bug PUP-7520
 
Re: Puppet profiling timers do not use a monotonic clock

Re-opening this one as inaccurate profiling results are far, far worse than not having any profiler functionality. This condition is uncommon, but Puppet does manage the sort of system configuration that can cause clock jumps.

This change probably doesn't even need to wait for a semver major like Puppet 8 at this point as Ruby 2.1 and older are deeply end of life.

This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Maggie Dreyer (Jira)

unread,
Jan 6, 2022, 1:25:02 PM1/6/22
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Feb 22, 2022, 2:47:01 PM2/22/22
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Labels: final_triage jira_escalated nice-to-have performance

Josh Cooper (Jira)

unread,
May 17, 2023, 2:13:02 PM5/17/23
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Epic Link: PUP-5773
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages