You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/04/20 11:18:00 UTC

[jira] [Commented] (KAFKA-9650) Include human readable quantities for default config docs

    [ https://issues.apache.org/jira/browse/KAFKA-9650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17087612#comment-17087612 ] 

ASF GitHub Bot commented on KAFKA-9650:
---------------------------------------

tombentley commented on a change in pull request #8222:
URL: https://github.com/apache/kafka/pull/8222#discussion_r411295815



##########
File path: clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
##########
@@ -1179,6 +1186,50 @@ protected String getConfigValue(ConfigKey key, String headerName) {
         }
     }
 
+    private static String niceMemoryUnits(ConfigKey key) {
+        final long defaultValueBytes = ((Number) key.defaultValue).longValue();
+        long defaultValue = defaultValueBytes;
+        int i = 0;
+        while (i < 5) {
+            if (defaultValue % 1024 != 0) {
+                break;
+            }
+            defaultValue /= 1024;
+            i++;
+        }
+        switch (i) {
+            case 1:
+                return " (=" + defaultValue + "KiB)";

Review comment:
       You're right, but in this case we're dealing with kibibytes, not kilobyes, and [it seems](https://en.wikipedia.org/wiki/Kibibyte) in this case KiB is the standard abbreviation.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Include human readable quantities for default config docs
> ---------------------------------------------------------
>
>                 Key: KAFKA-9650
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9650
>             Project: Kafka
>          Issue Type: Improvement
>          Components: docs
>            Reporter: Tom Bentley
>            Assignee: Tom Bentley
>            Priority: Trivial
>
> The Kafka config docs include default values for quantities in milliseconds and bytes, for example {{log.segment.bytes}} has default: {{1073741824}}. Many readers won't know that that's 1GiB, so will have to work it out. It would make the docs more readable if we included the quantity in the appropriate unit in parenthesis after the actual default value, like this:
> default: 1073741824 (=1GiB)
> Similarly for values in milliseconds. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)