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


Looks good! One last question about removing the use of casting to check for 
whole numbers.


3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp
<https://reviews.apache.org/r/11331/#comment51420>

    What about making this class a friend of Duration (to gain access to the 
constants) and then instead of using casting with doubles you can use just use 
mod operations on integers:
    
      int64_t nanoseconds = duration.ns();
     
        ...
    
        if (nanoseconds % MILLISECONDS != 0 && nanoseconds % MICROSECONDS == 0) 
{
          stream << duration.us() << "us";
        } else {
          stream << duration.ms() << "ms";
        }
    
    Would be nice to get rid of the double casting, thoughts?


- Ben Mahler


On Sept. 23, 2013, 9:28 p.m., Jiang Yan Xu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/11331/
> -----------------------------------------------------------
> 
> (Updated Sept. 23, 2013, 9:28 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Ben Mahler, Ian Downes, Jie Yu, 
> and Vinod Kone.
> 
> 
> Bugs: MESOS-477
>     https://issues.apache.org/jira/browse/MESOS-477
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> - Currently when the result isn't a whole number, we go one-level down in 
> terms of the unit of time and see if we can get a whole number there. If so, 
> use the lower unit; if not, use the higher unit.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp 
> 47e85ff8bbb310475dea382bfca9389c4295cf77 
>   3rdparty/libprocess/3rdparty/stout/tests/duration_tests.cpp 
> e0910d4c82c2289f8d08deadbf4a8ef0448d0f76 
> 
> Diff: https://reviews.apache.org/r/11331/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Jiang Yan Xu
> 
>

Reply via email to