Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
arnikola committed Jan 27, 2021
1 parent da2fb32 commit 5c1b8d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dbnode/storage/index/aggregate_results.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,16 @@ func (r *aggregatedResults) AggregateResultsOptions() AggregateResultsOptions {
func (r *aggregatedResults) AddFields(batch []AggregateResultsEntry) (int, int) {
r.Lock()
defer r.Unlock()

// NB: init total count with batch length, since each aggregated entry
// will have one field.
totalCount := len(batch)
for idx := 0; idx < len(batch); idx++ {
totalCount += len(batch[idx].Terms)
}

r.aggregateOpts.AggregateUsageMetrics.IncTotal(int64(totalCount))
remainingDocs := math.MaxInt64
r.aggregateOpts.AggregateUsageMetrics.IncTotal(int64(totalCount))
remainingDocs := math.MaxInt64
if r.aggregateOpts.DocsLimit != 0 {
remainingDocs = r.aggregateOpts.DocsLimit - r.totalDocsCount
}
Expand Down

0 comments on commit 5c1b8d7

Please sign in to comment.