MCPcopy
hub / github.com/grafana/tempo / AdjustTimeRangeForSlack

Function AdjustTimeRangeForSlack

tempodb/encoding/common/slackTimeRange.go:9–29  ·  view source on GitHub ↗
(tenantID string, ingestionSlack time.Duration, start, end uint32)

Source from the content-addressed store, hash-verified

7)
8
9func AdjustTimeRangeForSlack(tenantID string, ingestionSlack time.Duration, start, end uint32) (uint32, uint32) {
10 now := time.Now()
11 startOfRange := uint32(now.Add(-ingestionSlack).Unix())
12 endOfRange := uint32(now.Add(ingestionSlack).Unix())
13
14 warn := false
15 if start < startOfRange {
16 warn = true
17 start = uint32(now.Unix())
18 }
19 if end > endOfRange || end < start {
20 warn = true
21 end = uint32(now.Unix())
22 }
23
24 if warn {
25 dataquality.WarnOutsideIngestionSlack(tenantID)
26 }
27
28 return start, end
29}

Callers 3

AppendTraceMethod · 0.92
AppendTraceMethod · 0.92
AppendTraceMethod · 0.92

Calls 3

NowMethod · 0.65
AddMethod · 0.65

Tested by

no test coverage detected