> On Nov. 15, 2013, 10:33 p.m., Ben Mahler wrote:
> > src/webui/master/static/js/app.js, lines 86-88
> > <https://reviews.apache.org/r/15579/diff/1/?file=385447#file385447line86>
> >
> >     Good call, here's how we set up the variables in bytes.hpp, seems very 
> > obviously correct, maybe we could to the same here?
> >     
> >       static const uint64_t BYTES = 1;
> >       static const uint64_t KILOBYTES = 1024 * BYTES;
> >       static const uint64_t MEGABYTES = 1024 * KILOBYTES;
> >       static const uint64_t GIGABYTES = 1024 * MEGABYTES;
> >       static const uint64_t TERABYTES = 1024 * GIGABYTES;

But where does 1024 come from? It's 2^10!

That should be:

BYTES = 2^0
KILOBYTES = 2^10
MEGABYTES = 2^20
GIGABYTES = 2^30
TERABYTES = 2^40

I was tempted to go with the newer kibibyte, mebibyte, and gibibyte, but even 
I'm not sold on the names yet. They're more proper, but they sound odd.


- Ross


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15579/#review28995
-----------------------------------------------------------


On Nov. 15, 2013, 6:13 p.m., Ross Allen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/15579/
> -----------------------------------------------------------
> 
> (Updated Nov. 15, 2013, 6:13 p.m.)
> 
> 
> Review request for mesos.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Saved KB/MB/GB bytes as constants to save multiplication.
> 
> Each time the 'dataSize' filter was called, the function did lots of
> multiplication to get bytes per KB, MB, and GB to determine how to
> print the string.
> 
> Moving the constants outside the function returned by the filter means
> the multiplication is done only one time on app start up instead of in
> each call.
> 
> * Added 1 digit to the right of the decimal point for GB. 6.5 GB is
>   very different from 7 GB.
> 
> 
> Diffs
> -----
> 
>   src/webui/master/static/js/app.js 163c50b6cb88f33a23a1a3446d1a88070be26eab 
> 
> Diff: https://reviews.apache.org/r/15579/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Ross Allen
> 
>

Reply via email to