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

Modified that check burst value when run the function ValidateNetprofile #1145

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wangxf1987
Copy link
Contributor

Modified that check burst value when run the function ValidateNetprofile

Type of fix: Bug Fix

Please describe:

  • The burst is hard code, if want to achieve the desired performance,
    it's best to equal the value of bandwidth.
  • Add func ConvertBandwidth,that convert the bandwidth to bytes.
  • Modified func ValidateNetprofile.
  • Test pass on local env

TODO

  • Documentation

xiaofeiwang added 2 commits June 5, 2018 14:47
1. The burst is hard code, if want to achieve the desired performance,
   it's best to equal the value of bandwidth.
2. Add func ConvertBandwidth,that convert the bandwidth to bytes.
3. Modified func ValidateNetprofile.
4. Test pass on local env
@wangxf1987
Copy link
Contributor Author

@dseevr hi, I created a new branch and pushed it to the master, Please review ~, thanks

@@ -3457,7 +3458,8 @@ func ValidateNetprofile(obj *Netprofile) error {
return errors.New("bandwidth string invalid format")
}

if obj.Burst > 10486 {
bwint64 := netutils.ConvertBandwidth(obj.Bandwidth)
Copy link
Contributor

@dseevr dseevr Jun 6, 2018

Choose a reason for hiding this comment

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

Where is this function? It looks like it wasn't included in the PR, but I see it in the other PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The function from the netutils.ConvertBandwidth and we use it directly()。The function will be convert the Bandwidth value, and the value type is int64.

Copy link
Contributor Author

@wangxf1987 wangxf1987 left a comment

Choose a reason for hiding this comment

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

The commit may be out of date, At lease, It's cannot add the function(ConvertBandwidth), we import it directly and use it.

@@ -3457,7 +3458,8 @@ func ValidateNetprofile(obj *Netprofile) error {
return errors.New("bandwidth string invalid format")
}

if obj.Burst > 10486 {
bwint64 := netutils.ConvertBandwidth(obj.Bandwidth)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The function from the netutils.ConvertBandwidth and we use it directly()。The function will be convert the Bandwidth value, and the value type is int64.

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.

2 participants