-
Notifications
You must be signed in to change notification settings - Fork 41
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
bbr限流实现 maxInFlight 方法可能有误 #21
Comments
+0.5 是为了向上取整 |
加错位置了吧,应该先加 0.5 再进行 Floor 操作吧 |
why not use the comment for // Ceil returns the least integer value greater than or equal to x.
//
// Special cases are:
// Ceil(±0) = ±0
// Ceil(±Inf) = ±Inf
// Ceil(NaN) = NaN
func Ceil(x float64) float64 |
not same with +0.5 |
Hi, @DZGodly! I'm Dosu, and I'm here to help the aegis team manage their backlog. I wanted to let you know that we are marking this issue as stale. From what I understand, you raised a concern about a potential error in the implementation of the maxInFlight method in the bbr.go file of the go-kratos/aegis repository. Specifically, you questioned whether the placement of the 0.5 addition is incorrect, as the Floor function already returns an integer value that may be truncated by the int64() conversion. In the comments, haiyux and you discussed the placement of the 0.5 addition, while juwell suggested using math.Ceil() instead. lxkaka commented that +0.5 is not the same as using math.Ceil(). To help us keep track of the relevance of this issue, could you please let us know if it is still relevant to the latest version of the aegis repository? If it is, please comment on this issue to let us know. Otherwise, feel free to close the issue yourself, or the issue will be automatically closed in 7 days. Thank you for your contribution to the go-kratos/aegis repository! |
aegis/ratelimit/bbr/bbr.go
Line 235 in 56c0fb5
最后加的那个0.5是不是放错位置了。Floor函数返回的已经是一个整数值,在加 0.5 后,会被最外层的 int64() 截断吧
The text was updated successfully, but these errors were encountered: