Skip to content

Use monotonic clock in Glue metrics#14258

Merged
findepi merged 2 commits intotrinodb:masterfrom
pettyjamesm:glue-metrics-nanotime
Sep 26, 2022
Merged

Use monotonic clock in Glue metrics#14258
findepi merged 2 commits intotrinodb:masterfrom
pettyjamesm:glue-metrics-nanotime

Conversation

@pettyjamesm
Copy link
Copy Markdown
Member

@pettyjamesm pettyjamesm commented Sep 22, 2022

Description

Change usage of System.currentTimeMillis() to Guava's Stopwatch in Glue API stats collection, since System.currentTimeMillis() is not guaranteed to be monotonic and therefore not ideal for measuring elapsed time. Metrics are still recorded in milliseconds.

Non-technical explanation

No non-technical explanation is necessary.

Release notes

(x) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text:

@findepi
Copy link
Copy Markdown
Member

findepi commented Sep 23, 2022

System.currentTimeMillis() is the system wall clock time and can change due to daylight savings time

This is probably not true

or NTP updates,

NTP should generally "smooth out" (stretch or condense seconds/ticks)

@findepi findepi added the no-release-notes This pull request does not require release notes entry label Sep 23, 2022
Switches async glue API call timing to using Guava's Stopwatch
instead of System.currentTimeMillis() to measure elapsed time,
since the latter is not monotonic.
@findepi findepi merged commit 27b4fba into trinodb:master Sep 26, 2022
@github-actions github-actions bot added this to the 398 milestone Sep 26, 2022
@pettyjamesm pettyjamesm deleted the glue-metrics-nanotime branch September 26, 2022 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed no-release-notes This pull request does not require release notes entry

Development

Successfully merging this pull request may close these issues.

2 participants