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

Refactor ExecutionSegment sequences, wrappers and tuples #1446

Merged
merged 2 commits into from
May 13, 2020

Conversation

na--
Copy link
Member

@na-- na-- commented May 12, 2020

This cleans up the interfaces and makes it possible to re-use the heavy calculations for a segment sequence.

closes #1379

@na-- na-- added this to the v0.27.0 milestone May 12, 2020
@na-- na-- requested review from mstoykov and imiric May 12, 2020 13:17
@na--
Copy link
Member Author

na-- commented May 12, 2020

hmm not sure why this linter issue doesn't show locally 😕 I'll force-push...

This cleans up the interfaces and makes it possible to re-use the heavy calculations for a segment sequence.
@codecov-io
Copy link

Codecov Report

Merging #1446 into new-schedulers will decrease coverage by 0.02%.
The diff coverage is 91.55%.

Impacted file tree graph

@@                Coverage Diff                 @@
##           new-schedulers    #1446      +/-   ##
==================================================
- Coverage           76.34%   76.31%   -0.03%     
==================================================
  Files                 162      162              
  Lines               12936    12937       +1     
==================================================
- Hits                 9876     9873       -3     
- Misses               2545     2550       +5     
+ Partials              515      514       -1     
Impacted Files Coverage Δ
lib/executors.go 90.19% <ø> (ø)
lib/options.go 87.69% <ø> (ø)
lib/execution_segment.go 91.08% <89.07%> (-1.40%) ⬇️
lib/executor/constant_arrival_rate.go 97.51% <100.00%> (ø)
lib/executor/constant_looping_vus.go 96.66% <100.00%> (ø)
lib/executor/externally_controlled.go 59.23% <100.00%> (ø)
lib/executor/per_vu_iterations.go 97.08% <100.00%> (ø)
lib/executor/shared_iterations.go 97.52% <100.00%> (+0.06%) ⬆️
lib/executor/variable_arrival_rate.go 95.81% <100.00%> (ø)
lib/executor/variable_looping_vus.go 95.21% <100.00%> (+0.01%) ⬆️
... and 2 more

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 7dcbfe1...303c3ea. Read the comment docs.

// NewExecutionTuple returns a new ExecutionTuple for the provided segment and
// sequence.
//
// TODO: don't return a pointer?
Copy link
Contributor

Choose a reason for hiding this comment

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

The Pointer was required because fillCached needed to change the tuple so ... now this can be a not pointer :D

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, and I started doing it, but then I had to change like a 1000 uses... I don't mind doing it now, but if I had done it, I imagined you would have said (not incorrectly) something like "this could have been done later" 😉

Copy link
Contributor

Choose a reason for hiding this comment

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

It probably would - I remember moving from the non-pointer to the pointer variant and it took half an afternoon :). To be honest I don't think this is worth an issue, and it's likely won't better anything if changed at this point. I just wanted to point (pun intented :P) out why this was the case :D

Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

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

LGTM!
I do think now, that we have used it somewhat throughout the code, we can do a lot of those changes and I like the new API somewhat better than the old. Especially the whole no need to provide the segment the whole time.

lib/executor/constant_arrival_rate.go Outdated Show resolved Hide resolved
prev[index] = iteration
if int64(len(offsets[index])) == numerator {
offsets[index] = append(offsets[index], offsets[index][0]+lcd-iteration)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I like that this lambda is not external anymore, and the algorithm is in a single place now. 👍

@na-- na-- merged commit e09562d into new-schedulers May 13, 2020
@na-- na-- deleted the ess-cleanup branch May 14, 2020 13:43
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.

4 participants