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

Function includeBlock

modules/livestore/instance_search.go:943–955  ·  view source on GitHub ↗

includeBlock uses the provided time range to determine if the block should be included in the search.

(b *backend.BlockMeta, start, end time.Time)

Source from the content-addressed store, hash-verified

941
942// includeBlock uses the provided time range to determine if the block should be included in the search.
943func includeBlock(b *backend.BlockMeta, start, end time.Time) bool {
944 startNano := start.UnixNano()
945 endNano := end.UnixNano()
946
947 if startNano == 0 || endNano == 0 {
948 return true
949 }
950
951 blockStart := b.StartTime.UnixNano()
952 blockEnd := b.EndTime.UnixNano()
953
954 return blockStart <= endNano && blockEnd >= startNano
955}
956
957// searchTagValuesV2CacheKey generates a cache key for the searchTagValuesV2 request
958// cache key is used as the filename to store the protobuf data on disk

Callers 2

TestIncludeBlockFunction · 0.70
iterateBlocksMethod · 0.70

Calls

no outgoing calls

Tested by 1

TestIncludeBlockFunction · 0.56