-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Refactor and add connect all client #20173
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Nont <nont@duck.com> Add doable Signed-off-by: Nont <nont@duck.com>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nwnt The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@nwnt: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted filessee 18 files with indirect coverage changes @@ Coverage Diff @@
## main #20173 +/- ##
==========================================
- Coverage 69.27% 69.24% -0.03%
==========================================
Files 413 413
Lines 34364 34364
==========================================
- Hits 23805 23797 -8
- Misses 9160 9170 +10
+ Partials 1399 1397 -2 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
MaxNonUniqueRequestConcurrency: 3, | ||
} | ||
HighTrafficProfile = Profile{ | ||
MinimalQPS: 100, | ||
MaximalQPS: 1000, | ||
BurstableQPS: 1000, | ||
ClientCount: 8, | ||
MemberClientCount: 8, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a one cluster client here too?
reporting reporter | ||
ids identity.Provider | ||
baseTime time.Time | ||
finish <-chan struct{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should watch out when creating struct based on collection of argument variables, not all variables are equal.
Don't think finish
make sense here. It's more like context, and should be passed like it.
func (s *simulator) runSingleMemberTraffic(ctx context.Context) { | ||
for i := range profile.MemberClientCount { | ||
c := connect([]string{s.hosts[i%len(s.hosts)]}, s.ids, s.baseTime) | ||
go s.reporting.makeReportOf(trafficLoad(ctx, s.tf, s.limiter, s.ids, s.storage, s.concurrencyLimiter, s.keyStore, s.finish)).usingClient(c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one line is overloaded. Shorter doesn't mean better,
} | ||
} | ||
|
||
func (s *simulator) runAllMemberTraffic(ctx context.Context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no reason to have separate function for running all member traffic vs single member traffic. It's almost the same code structure. Separating things like this implies that they are less related causing potential confusion in reader.
@@ -43,7 +43,8 @@ var ( | |||
MinimalQPS: 100, | |||
MaximalQPS: 1000, | |||
BurstableQPS: 1000, | |||
ClientCount: 3, | |||
MemberClientCount: 3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't recommend mixing refactors and feature changes. Can you send a separate PR?
} | ||
} | ||
|
||
type reporter struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This struct is confusing for me, I don't understand what's doing. Can you instead adopt more #19893 like approach?
Fix #20052
This also contains quite extensive refactoring for
simulateTraffic
.