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

Function TestDaemonStateAggregateMax

fbclock/daemon/daemon_test.go:83–114  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

81}
82
83func TestDaemonStateAggregateMax(t *testing.T) {
84 s := newDaemonState(3)
85
86 probes := []*DataPoint{
87 {
88 MasterOffsetNS: 123.0,
89 PathDelayNS: 3,
90 FreqAdjustmentPPB: 4,
91 },
92 {
93 MasterOffsetNS: -2000.0,
94 PathDelayNS: 300,
95 FreqAdjustmentPPB: 2,
96 },
97 {
98 MasterOffsetNS: 1009.0,
99 PathDelayNS: 200,
100 FreqAdjustmentPPB: 5,
101 },
102 }
103
104 for _, tr := range probes {
105 s.pushDataPoint(tr)
106 }
107 got := s.aggregateDataPointsMax(3)
108 want := &DataPoint{
109 MasterOffsetNS: 2000.0,
110 PathDelayNS: 300,
111 FreqAdjustmentPPB: 5,
112 }
113 require.Equal(t, want, got)
114}
115
116func TestTargetsChange(t *testing.T) {
117 testCases := []struct {

Callers

nothing calls this directly

Calls 3

newDaemonStateFunction · 0.85
pushDataPointMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…