Open skyzyx opened 7 years ago
Thank you for your suggestion. Yes, the current appearance is not user-friendly when the value is large. To read the value like 1000000000
is pretty suffering.
I come up with 3 options to solve this issue:
1000000000
will be 1,000,000,000
.1000000000
will be 1G
.1000000000
will be 953.6M
.In the case of bytes, the option 3 is preferable. But the option 2 looks suitable to show the response time or the number of API calls.
Also, I guess a visitor to the status page can't immediately realize whether 1G
means 1000000000
or 1073741824
.
So I think the option 1 is the more general and less confusing than others, though it's a little harder to read if the value is very large.
As the quick fix, I've implemented the option 1 and it will be available since v0.4.0. But I'm going to keep this issue open for a while since I'd like to know more opinions.
How about setting a data type and then using javascript on the front end to make it user readable based on the type?
function bytesToSize(bytes) { var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB']; if (bytes == 0) return '0 Byte'; var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024))); return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i]; };
A javascript solution is best and simplest I think
CloudWatch data comes back as bytes. Being able to convert
4352360851042
into3.958 TB
would be useful and more human-friendly.