You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/08/26 18:31:23 UTC

[GitHub] [cloudstack-cloudmonkey] pdion891 opened a new issue #94: add human readable output

pdion891 opened a new issue #94:
URL: https://github.com/apache/cloudstack-cloudmonkey/issues/94


   when displaying volume info, it would be great if we could see the size attribute in human readable form instead of scientific,
   example: 
   
   current output:
   ```
   > list volumes type=DATADISK filter=size
   count = 1
   volume:
   +-----------------+
   |      SIZE       |
   +-----------------+
   | 5.36870912e+10  |
   +-----------------+
   ```
   
   new output: 
   ```
   > list volumes type=DATADISK filter=size
   count = 1
   volume:
   +-----------------+
   |      SIZE       |
   +-----------------+
   |      50 GB      |
   +-----------------+
   ```
   
   Maybe we could have a configuration `humanformat=true` in the config file too ?
   


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-cloudmonkey] rhtyd edited a comment on issue #94: add human readable output

Posted by GitBox <gi...@apache.org>.
rhtyd edited a comment on issue #94:
URL: https://github.com/apache/cloudstack-cloudmonkey/issues/94#issuecomment-908915481


   The linked PR fixes the formatting issue, however it doesn't do what @pdion891 has asked - PL please check if the PR is sufficient to close the ticket as ideally the human readable change should come from API key so the CLI shouldn't alter the response too much. 


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-cloudmonkey] rhtyd commented on issue #94: add human readable output

Posted by GitBox <gi...@apache.org>.
rhtyd commented on issue #94:
URL: https://github.com/apache/cloudstack-cloudmonkey/issues/94#issuecomment-908915481


   The linked PR fixes the formatting issue, however it doesn't do what @pdion891 has asked - PL please check if the PR is sufficient to close the ticket? 


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-cloudmonkey] rhtyd commented on issue #94: add human readable output

Posted by GitBox <gi...@apache.org>.
rhtyd commented on issue #94:
URL: https://github.com/apache/cloudstack-cloudmonkey/issues/94#issuecomment-907024782


   Good idea, I think it's sort of a regression - we shouldn't round of to the `x.xeY` format. This only happens for the text output, does not happy for the json output.
   The immediate fix we can attempt is to output the same number (as-is) than change the format cc @Pearl1594 


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-cloudmonkey] rhtyd closed issue #94: add human readable output

Posted by GitBox <gi...@apache.org>.
rhtyd closed issue #94:
URL: https://github.com/apache/cloudstack-cloudmonkey/issues/94


   


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-cloudmonkey] rhtyd closed issue #94: add human readable output

Posted by GitBox <gi...@apache.org>.
rhtyd closed issue #94:
URL: https://github.com/apache/cloudstack-cloudmonkey/issues/94


   


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-cloudmonkey] rhtyd commented on issue #94: add human readable output

Posted by GitBox <gi...@apache.org>.
rhtyd commented on issue #94:
URL: https://github.com/apache/cloudstack-cloudmonkey/issues/94#issuecomment-908915481


   The linked PR fixes the formatting issue, however it doesn't do what @pdion891 has asked - PL please check if the PR is sufficient to close the ticket? 


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-cloudmonkey] Pearl1594 commented on issue #94: add human readable output

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on issue #94:
URL: https://github.com/apache/cloudstack-cloudmonkey/issues/94#issuecomment-911605016


   It does look better with the approach you've mentioned @pdion891. However, this may not work for fields like cpunumber, cpuspeed, bits, count, etc - but it's worth exploring! 


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-cloudmonkey] rhtyd commented on issue #94: add human readable output

Posted by GitBox <gi...@apache.org>.
rhtyd commented on issue #94:
URL: https://github.com/apache/cloudstack-cloudmonkey/issues/94#issuecomment-910438699


   That looks good - but then the issue is on which int64 inputs (i.e. response keys) should we apply this logic? (probably anything with size in the substring? however it may fail if it's not storage related key)


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-cloudmonkey] rhtyd edited a comment on issue #94: add human readable output

Posted by GitBox <gi...@apache.org>.
rhtyd edited a comment on issue #94:
URL: https://github.com/apache/cloudstack-cloudmonkey/issues/94#issuecomment-908915481


   The linked PR fixes the formatting issue, however it doesn't do what @pdion891 has asked - PL please check if the PR is sufficient to close the ticket as ideally the human readable change should come from API key so the CLI shouldn't alter the response too much. 


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-cloudmonkey] pdion891 commented on issue #94: add human readable output

Posted by GitBox <gi...@apache.org>.
pdion891 commented on issue #94:
URL: https://github.com/apache/cloudstack-cloudmonkey/issues/94#issuecomment-910436978


   The #95  make reading better than before but I think it would be cleaner if we could get a more human interpreted version. 
   
   is such code could help ?  
   ```
   func convert(i int64) string {
   	v := []string{"B", "KB", "MB", "GB", "TB", "PB", "EB"}
   	l := 0
   	for ; i > 1024; i = i / 1024 {
   		l++
   	}
   	return fmt.Sprintf("%d %s", i, v[l])
   }
   ```
   
   This could work for any field that are `size` or `memory`,  but cannot be use for all integer type because that would not make sense for cpu count as example.
   


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-cloudmonkey] pdion891 commented on issue #94: add human readable output

Posted by GitBox <gi...@apache.org>.
pdion891 commented on issue #94:
URL: https://github.com/apache/cloudstack-cloudmonkey/issues/94#issuecomment-910439645


   `int64` in that snippet can be changed. 
   


-- 
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: dev-unsubscribe@cloudstack.apache.org

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



[GitHub] [cloudstack-cloudmonkey] pdion891 commented on issue #94: add human readable output

Posted by GitBox <gi...@apache.org>.
pdion891 commented on issue #94:
URL: https://github.com/apache/cloudstack-cloudmonkey/issues/94#issuecomment-911620957


   @Pearl1594 for sur this kind of output is only valid for Size type of attribute.
   
   Would there be a way to know if an attribute name contain `size` and if it does the value would be process to have `GB` output style ?
   


-- 
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: dev-unsubscribe@cloudstack.apache.org

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