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

Function TestPushAndTakeDataPoint

fbclock/daemon/state_test.go:38–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

36 s.pushDataPoint(dp3)
37
38 got := s.takeDataPoint(3)
39 require.Len(t, got, 3)
40 require.Equal(t, dp3, got[0])
41 require.Equal(t, dp2, got[1])
42 require.Equal(t, dp1, got[2])
43}
44
45func TestTakeDataPointPartial(t *testing.T) {
46 s := newDaemonState(5)
47
48 dp1 := &DataPoint{MasterOffsetNS: 1.0}
49 dp2 := &DataPoint{MasterOffsetNS: 2.0}
50 s.pushDataPoint(dp1)
51 s.pushDataPoint(dp2)
52
53 got := s.takeDataPoint(5)
54 require.Len(t, got, 2)
55}
56
57func TestTakeDataPointOverflow(t *testing.T) {

Callers

nothing calls this directly

Calls 4

newDaemonStateFunction · 0.85
pushDataPointMethod · 0.80
takeDataPointMethod · 0.80
LenMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…