2016-06-06 03:31:21 -05:00
|
|
|
package tsdb
|
|
|
|
|
|
|
|
import "sync"
|
|
|
|
|
|
|
|
type QueryContext struct {
|
2016-09-27 11:17:39 -05:00
|
|
|
TimeRange *TimeRange
|
2016-06-06 03:31:21 -05:00
|
|
|
Queries QuerySlice
|
|
|
|
Results map[string]*QueryResult
|
|
|
|
ResultsChan chan *BatchResult
|
|
|
|
Lock sync.RWMutex
|
|
|
|
BatchWaits sync.WaitGroup
|
|
|
|
}
|
|
|
|
|
2016-09-27 11:17:39 -05:00
|
|
|
func NewQueryContext(queries QuerySlice, timeRange *TimeRange) *QueryContext {
|
2016-06-06 03:31:21 -05:00
|
|
|
return &QueryContext{
|
|
|
|
TimeRange: timeRange,
|
|
|
|
Queries: queries,
|
|
|
|
ResultsChan: make(chan *BatchResult),
|
|
|
|
Results: make(map[string]*QueryResult),
|
|
|
|
}
|
|
|
|
}
|