cserwen commented on a change in pull request #87:
URL: https://github.com/apache/rocketmq-exporter/pull/87#discussion_r779270656
##########
File path:
src/main/java/org/apache/rocketmq/exporter/model/BrokerRuntimeStats.java
##########
@@ -131,10 +131,22 @@ public BrokerRuntimeStats(KVTable kvTable) {
private void loadCommitLogDirCapacity(String commitLogDirCapacity) {
String[] arr = commitLogDirCapacity.split(" ");
- double total = Double.parseDouble(arr[2]);
- double free = Double.parseDouble(arr[6]);
- this.commitLogDirCapacityTotal = total;
- this.commitLogDirCapacityFree = free;
+ String total = String.format("%s %s", arr[2], arr[3].substring(0,
arr[3].length() - 1));
+ String free = String.format("%s %s", arr[6], arr[7].substring(0,
arr[7].length() - 1));
+ this.commitLogDirCapacityTotal = machineReadableByteCount(total);
+ this.commitLogDirCapacityFree = machineReadableByteCount(free);
+ }
+
+ private double machineReadableByteCount(String humanReadableValue) {
+ int unitSize = 1024;
+ String[] valueArray = humanReadableValue.split(" ");
Review comment:
Thanks for your suggestion, I will add it later.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]