MCPcopy
hub / github.com/prometheus/prometheus / TestIsSampleOld

Function TestIsSampleOld

storage/remote/queue_manager_test.go:1965–1969  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1963}
1964
1965func TestIsSampleOld(t *testing.T) {
1966 currentTime := time.Now()
1967 require.True(t, isSampleOld(currentTime, 60*time.Second, timestamp.FromTime(currentTime.Add(-61*time.Second))))
1968 require.False(t, isSampleOld(currentTime, 60*time.Second, timestamp.FromTime(currentTime.Add(-59*time.Second))))
1969}
1970
1971// Simulates scenario in which remote write endpoint is down and a subset of samples is dropped due to age limit while backoffing.
1972func TestSendSamplesWithBackoffWithSampleAgeLimit(t *testing.T) {

Callers

nothing calls this directly

Calls 3

FromTimeFunction · 0.92
isSampleOldFunction · 0.85
AddMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…