-
Notifications
You must be signed in to change notification settings - Fork 210
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
Move perf test command to separate subcommand #2168
Conversation
12a0bec
to
f0ff431
Compare
f0ff431
to
de07125
Compare
de07125
to
c82a67c
Compare
c82a67c
to
9abae58
Compare
/cc @darox @learnitall |
05dfd80
to
9248a9a
Compare
Great, I planned to work on refactoring, but you were faster. Planning to have a look at it this week (obviously customer tickets have priority). |
I think we can diregard |
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.
@marseel Nice work! Just a few small picks...
d.Latency["p90"][0], d.Metric, | ||
d.Latency["p99"][0], d.Metric) | ||
ct.Header("🔥 Network Performance Test Summary:") | ||
ct.Logf("%s", strings.Repeat("-", 200)) |
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.
Might be cleaner to define a PerfResult type vs the simple map and hang Printer methods to output the different perf tables. Also you could hang helpers aka nodeString.
We could perhaps leverage a table printing lib and use it for tabular output.
Lastly we could sort the results to make it for a quick perf scan.
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 agree that using some kind of table lib would be great.
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.
So I definitely agree with using some lib for printing table and also cleaning up this mess, but I think it's out of scope of this PR. I am happy to create follow-up issue for that.
Re sorting, results are already sorted in PerfResults
- that's why I changed it from map to list (before they weren't sorted) + added sorting here
cilium-cli/connectivity/check/deployment.go
Line 1097 in 0099fbf
sort.SliceStable(ct.perfServerPod, func(i, j int) bool { |
While I would do it differently normally and sort results in the
presentation
layer, I wanted to do it as simply as possible for now as this part was not really my goal of improving console presentation format.
res.Latency = nil | ||
// Verify that throughput unit is 10^6bits/s | ||
if values[8] != "10^6bits/s" { | ||
a.Fatal("Unable to process netperf result") |
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.
Perhaps this call should return an err and let the call site decide vs bombing?
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 think it's worth it - we already handle a bunch of errors through a.Fatal
- FYI this is just failing a single action, not the whole program.
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.
Thank you for doing this, I'm very excited for the perfdash integration. I have a couple of suggestions and nits, please let me know what you think.
d.Latency["p90"][0], d.Metric, | ||
d.Latency["p99"][0], d.Metric) | ||
ct.Header("🔥 Network Performance Test Summary:") | ||
ct.Logf("%s", strings.Repeat("-", 200)) |
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 agree that using some kind of table lib would be great.
Thanks for the reviews, I pushed changed as separate commit to make it easier for you to review it - I will squash them later on. |
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.
@marseel SG - Thanks for the updates!
I see you removed me from the reviewers. Makes sense, the others have deeper Go knowledge than me. |
Before, perf test was part of `connectivity test` subcommand. Now, perf test has separate `connectivity perf` subcommand. We allow to run both host and pod network perf test in a single command. We allow to test host-to-pod type of traffic too. Perf test now respects nodeSelector and allows to run for nodes in two different zones. Always force deploy test pods for perf test to respect nodeSelector. You can export perf test results in json format, which is compatible with perfdash. Fixes: #1111 Fixes: #2114 Signed-off-by: Marcel Zieba <[email protected]>
76325d1
to
ddbd54a
Compare
Since I removed |
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.
Looks reasonable to me.
I'm marking this PR as ready-to-merge as tests passed before with |
I believe this pull request broke main. At least, the following is currently failing for me on main locally and in my rebased PR:
|
I really tried to be mindful of splitting that into commits, but unfortunately, I ended up refactoring the whole thing 😢
Summary:
cilium connectivity test --perf
to separate subcommandcilium connectivity perf
Help for perf subcommand:
Example output of full tests:
Fixes #1111
Fixes #2114