MCPcopy
hub / github.com/google/mangle / GetEndTime

Function GetEndTime

factstore/interval_tree.go:367–378  ·  view source on GitHub ↗

GetEndTime extracts the end time from an interval. Returns MaxInt64 for unbounded end (positive infinity).

(interval ast.Interval)

Source from the content-addressed store, hash-verified

365// GetEndTime extracts the end time from an interval.
366// Returns MaxInt64 for unbounded end (positive infinity).
367func GetEndTime(interval ast.Interval) int64 {
368 switch interval.End.Type {
369 case ast.TimestampBound:
370 return interval.End.Timestamp
371 case ast.PositiveInfinityBound:
372 return maxInt64
373 case ast.NegativeInfinityBound:
374 return minInt64
375 default:
376 return 0
377 }
378}
379
380// containsTimestamp checks if an interval contains a timestamp.
381func containsTimestamp(interval ast.Interval, timestamp int64) bool {

Callers 6

bindIntervalVariablesMethod · 0.92
insertMethod · 0.85
queryRangeMethod · 0.85
updateMaxEndFunction · 0.85
containsTimestampFunction · 0.85
GetFactsDuringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected