MCPcopy Create free account
hub / github.com/facebook/time / Daemon

Struct Daemon

fbclock/daemon/daemon.go:110–131  ·  view source on GitHub ↗

Daemon is a component of fbclock that runs continuously, talks to ptp4l, does the math and populates shared memory for client library to read from.

Source from the content-addressed store, hash-verified

108}
109
110// Daemon is a component of fbclock that
111// runs continuously,
112// talks to ptp4l,
113// does the math
114// and populates shared memory for client library to read from.
115type Daemon struct {
116 DataFetcher
117 cfg *Config
118 state *daemonState
119 stats stats.Server
120 l Logger
121
122 // function to get PHC time from configured PHC device
123 getPHCTime func() (time.Time, error)
124 // getPHCAndSysTime returns PHC time, system time, system clock id, and the
125 // PHC↔sys round-trip delay observed during the read (uncertainty bound).
126 // Uses the MONOTONIC_RAW preferred path (existing behavior) for the primary
127 // snapshot that fbclock_gettime consumes.
128 getPHCAndSysTime func() (time.Time, time.Time, uint32, time.Duration, error)
129 // getPHCAndSysTimeRealtime is a parallel snapshot taken with CLOCK_REALTIME.
130 // Populates the realtime anchor used by fbclock_gettime_past so callers can
131 // translate kernel SO_TIMESTAMPING software timestamps (always REALTIME)
132 // without affecting the precision of the primary anchor.
133 getPHCAndSysTimeRealtime func() (time.Time, time.Time, time.Duration, error)
134 // function to get PHC freq from configured PHC device

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected