MCPcopy Create free account
hub / github.com/cortexproject/cortex / UseBeforeTimestampQueryable

Function UseBeforeTimestampQueryable

pkg/querier/querier.go:666–675  ·  view source on GitHub ↗

Returns QueryableWithFilter, that is used only if query starts before given timestamp. If timestamp is zero (time.IsZero), queryable is always used.

(queryable storage.Queryable, ts time.Time)

Source from the content-addressed store, hash-verified

664// Returns QueryableWithFilter, that is used only if query starts before given timestamp.
665// If timestamp is zero (time.IsZero), queryable is always used.
666func UseBeforeTimestampQueryable(queryable storage.Queryable, ts time.Time) QueryableWithFilter {
667 t := int64(0)
668 if !ts.IsZero() {
669 t = util.TimeToMillis(ts)
670 }
671 return useBeforeTimestampQueryable{
672 Queryable: queryable,
673 ts: t,
674 }
675}
676
677func validateQueryTimeRange(ctx context.Context, userID string, startMs, endMs int64, limits *validation.Overrides, maxQueryIntoFuture time.Duration) (int64, int64, error) {
678 now := model.Now()

Calls 1

TimeToMillisFunction · 0.92