Skip to content

Commit

Permalink
align chrony and ptp smearing timelines
Browse files Browse the repository at this point in the history
Summary: Bring 2 smearing strategies to start/finish at the same time

Reviewed By: deathowl

Differential Revision: D66967712
  • Loading branch information
leoleovich authored and facebook-github-bot committed Dec 9, 2024
1 parent 7e26de0 commit 293ddd5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fbclock/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (

const (
utcOffsetOriginalS int32 = 10 // UTC-TAI offset was 10s before leap seconds started (1972)
leapDurationS uint64 = 65000 // 18.06 hours
leapDurationS uint64 = 62500 // 17.36 hours https://chrony-project.org/doc/4.6/chrony.conf.html
monPrefix string = "linearizability."
)

Expand Down
6 changes: 3 additions & 3 deletions fbclock/daemon/daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ func TestDaemonCalculateSHMData(t *testing.T) {
ErrorBoundNS: 123.0,
HoldoverMultiplierNS: 64.5,
SmearingStartS: 1483228836,
SmearingEndS: 1483293836,
SmearingEndS: 1483291336,
UTCOffsetPreS: 36,
UTCOffsetPostS: 37,
}
Expand Down Expand Up @@ -464,7 +464,7 @@ func TestDaemonCalculateSHMData(t *testing.T) {
ErrorBoundNS: 157,
HoldoverMultiplierNS: 9362.84482758621,
SmearingStartS: 1483228836,
SmearingEndS: 1483293836,
SmearingEndS: 1483291336,
UTCOffsetPreS: 36,
UTCOffsetPostS: 37,
}
Expand Down Expand Up @@ -673,7 +673,7 @@ func TestLeapSecondSmearing(t *testing.T) {
got := leapSecondSmearing(leaps)
want := &clockSmearing{
smearingStartS: 1483228836, // Sun, 01 Jan 2017 00:00:36 TAI (or Sat, 31 Dec 2016 12:00:00 UTC)
smearingEndS: 1483293836, // Sun, 01 Jan 2017 18:03:56 TAI (or Sun, 01 Jan 2017 18:03:19 UTC)
smearingEndS: 1483291336, // Sun, 01 Jan 2017 17:22:53 TAI (or Sun, 01 Jan 2017 17:22:16 UTC)
utcOffsetPreS: 35,
utcOffsetPostS: 36,
}
Expand Down

0 comments on commit 293ddd5

Please sign in to comment.