Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[query] Fix a bug with step iteration allocating #2185

Merged
merged 13 commits into from
Mar 7, 2020

Conversation

arnikola
Copy link
Collaborator

@arnikola arnikola commented Mar 2, 2020

No description provided.

@@ -63,7 +63,7 @@ func NewStepLookbackConsolidator(
startTime time.Time,
fn ConsolidationFunc,
) *StepLookbackConsolidator {
datapoints := make([]ts.Datapoint, 0, initLength)
datapoints := make([]ts.Datapoint, 0, initLength*BufferSteps)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, should this perhaps just be BufferSteps instead of initLength*BufferSteps?

From my current perhaps limited understanding we should only ever be buffering up to BufferSteps max in c.unconsumed so having 320 values instead of 32 values (initLength=10, BufferSteps=32) able to be buffered might be a bit of a waste given *StepLookbackConsolidator should not need more than 32?

@@ -108,6 +108,7 @@ func (c *StepLookbackConsolidator) ConsolidateAndMoveToNext() float64 {
}

val := c.unconsumed[0]
c.unconsumed = c.unconsumed[1:]
copy(c.unconsumed, c.unconsumed[1:])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also want to make this change in step_accumulator right?

Comment on lines 140 to 142
// iteratorPoolSize = 1000
// checkedBytesWrapperPoolSize = 128
// defaultIdentifierPoolSize = 128
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: delete

// defaultIdentifierPoolSize = 128

// BuildIteratorPoolsOptions is a set of build iterator pools.
type BuildIteratorPoolsOptions struct {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe better to take in these values as a constructor rather than exposing the internal variables for mutation?

@robskillington robskillington changed the title [query] fix a bug with step iteration allocating [query] Fix a bug with step iteration allocating Mar 6, 2020
@codecov
Copy link

codecov bot commented Mar 7, 2020

Codecov Report

Merging #2185 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #2185   +/-   ##
======================================
  Coverage    72.2%   72.2%           
======================================
  Files        1019    1019           
  Lines       88946   88946           
======================================
  Hits        64278   64278           
  Misses      20373   20373           
  Partials     4295    4295           
Flag Coverage Δ
#aggregator 82.0% <0.0%> (ø)
#cluster 85.3% <0.0%> (ø)
#collector 82.8% <0.0%> (ø)
#dbnode 79.2% <0.0%> (ø)
#m3em 74.4% <0.0%> (ø)
#m3ninx 74.7% <0.0%> (ø)
#m3nsch 51.1% <0.0%> (ø)
#metrics 17.6% <0.0%> (ø)
#msg 74.9% <0.0%> (ø)
#query 67.9% <0.0%> (ø)
#x 83.2% <0.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7942aa...4166557. Read the comment docs.

Copy link
Collaborator

@robskillington robskillington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@robskillington robskillington merged commit b633cfd into master Mar 7, 2020
@robskillington robskillington deleted the arnikola/fix-step-iter branch March 7, 2020 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants