You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/04/25 12:35:31 UTC
[GitHub] [pulsar] erobot commented on a diff in pull request #15304: [fix][loadbalance] Fix wrong unit of NIC speed on linux
erobot commented on code in PR #15304:
URL: https://github.com/apache/pulsar/pull/15304#discussion_r857577704
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/LinuxInfoUtils.java:
##########
@@ -254,7 +254,7 @@ public double convertBy(double usageBytes) {
@AllArgsConstructor
public enum UsageUnit {
- Kbps(8 / 1024);
+ Kbps(1024);
Review Comment:
https://github.com/apache/pulsar/blob/35c4b68f586774d0e2b7a3a2a6ab1d6a20ac1452/pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/LinuxBrokerHostUsageImpl.java#L114-L115
From this codes, usage and limit should have the same unit kbps so I thought this should be bit and usageBytes*8/1000.
By the way, UsageUnit.Kbps is somewhat misleading. It used to convert usageBytes but usageBytes's is size(byte) but not speed(kbps).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org