mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-10 15:14:09 +00:00
app/vmselect: return the upper bound on the number of found time series from storage.Search.Init
This is used by a single-node version in order to reduce memory allocations during search.
See bc8381613d
for details.
This commit is contained in:
parent
b690eeff53
commit
a2039b3bbc
1 changed files with 5 additions and 2 deletions
|
@ -155,7 +155,9 @@ func (s *Search) reset() {
|
|||
// Init initializes s from the given storage, tfss and tr.
|
||||
//
|
||||
// MustClose must be called when the search is done.
|
||||
func (s *Search) Init(storage *Storage, tfss []*TagFilters, tr TimeRange, maxMetrics int, deadline uint64) {
|
||||
//
|
||||
// Init returns the upper bound on the number of found time series.
|
||||
func (s *Search) Init(storage *Storage, tfss []*TagFilters, tr TimeRange, maxMetrics int, deadline uint64) int {
|
||||
if s.needClosing {
|
||||
logger.Panicf("BUG: missing MustClose call before the next call to Init")
|
||||
}
|
||||
|
@ -175,10 +177,11 @@ func (s *Search) Init(storage *Storage, tfss []*TagFilters, tr TimeRange, maxMet
|
|||
|
||||
if err != nil {
|
||||
s.err = err
|
||||
return
|
||||
return 0
|
||||
}
|
||||
|
||||
s.storage = storage
|
||||
return len(tsids)
|
||||
}
|
||||
|
||||
// MustClose closes the Search.
|
||||
|
|
Loading…
Reference in a new issue