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

fix: network connectivity speed #360

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rxy0210
Copy link
Member

@rxy0210 rxy0210 commented Jan 5, 2024

What type of PR is this?

/kind bug

What does this PR do?

Improves the speed of checking network connectivity

Which issue(s) does this PR fix?

Fixes #238

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

@rxy0210
Copy link
Member Author

rxy0210 commented Jan 5, 2024

I switched branches and submitted.
#237

@@ -92,6 +94,7 @@ func NewCmdCheck() *cobra.Command {
flags.StringVar(&o.Port, "port", "8889", "Port used by floater.")
flags.IntVarP(&o.PodWaitTime, "pod-wait-time", "w", 30, "Time for wait pod(floater) launch.")
flags.StringVar(&o.Protocol, "protocol", string(TCP), "Protocol for the network problem.")
flags.IntVarP(&o.routinesMaxNum, "routines-max-number", "", 5, "Number of goroutines to use.")
Copy link
Member

Choose a reason for hiding this comment

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

It seems to be a feasible method. Can a single test provide more detailed loss output?
Considering that excessive goroutines may cause a certain burden on the native network, if routines-max-number is set to 100 or more, how much traffic will the floater consume?

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, i will try it

@kosmos-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rxy0210
To complete the pull request process, please assign orangebao after the PR has been reviewed.
You can assign the PR to them by writing /assign @orangebao in a comment when ready.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rxy0210 rxy0210 force-pushed the feature_network_speed branch 2 times, most recently from 370a01d to 37e07f9 Compare January 8, 2024 09:23
// ToDo RunRange && RunNative func support multiple commands, and the code needs to be optimized
cmdObj := &command.Ping{
TargetIP: targetIP,
goroutinePool <- 1
Copy link
Contributor

Choose a reason for hiding this comment

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

use struct{}{} instead 1

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, i have fixed it

routineIPodInfo := iPodInfo
routineJPodInfo := jPodInfo
routineIp := ip
go func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can definite a func to extract the logic. like go XXXX()

Copy link
Member Author

Choose a reason for hiding this comment

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

i fixed it

@kosmos-robot
Copy link
Contributor

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kosmosctl checks that the network connectivity speed is slow
4 participants