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

Function traceIsReady

cmd/tempo-vulture/main.go:299–305  ·  view source on GitHub ↗

Don't attempt to read on the first iteration if we can't reasonably expect the write loop to have fired yet. Double the duration here to avoid a race.

(info *util.TraceInfo, now time.Time, startTime time.Time, writeBackoff time.Duration, longBackoff time.Duration)

Source from the content-addressed store, hash-verified

297// expect the write loop to have fired yet. Double the duration here to
298// avoid a race.
299func traceIsReady(info *util.TraceInfo, now time.Time, startTime time.Time, writeBackoff time.Duration, longBackoff time.Duration) bool {
300 if info.Timestamp().Before(startTime.Add(2 * writeBackoff)) {
301 return false
302 }
303
304 return info.Ready(now, writeBackoff, longBackoff)
305}
306
307func doWrite(jaegerClient util.JaegerClient, tickerWrite *time.Ticker, interval time.Duration, config vultureConfiguration, l *zap.Logger) {
308 go func() {

Callers 2

TestTraceIsReadyFunction · 0.85
runCheckerFunction · 0.85

Calls 3

TimestampMethod · 0.80
ReadyMethod · 0.80
AddMethod · 0.65

Tested by 1

TestTraceIsReadyFunction · 0.68