You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Ben Mahler <be...@gmail.com> on 2013/07/26 00:06:00 UTC

Review Request 12951: Fixed JSON::Number output precision, and added a test.

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

Review request for mesos, Benjamin Hindman and Vinod Kone.


Repository: mesos-git


Description
-------

JSON::Number was output using a precision of 10 digits, whereas double precision guarantees 15 digits of accuracy.

Digits 16 and 17 may be bogus, so kept it at 15. See: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2005.pdf


Diffs
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp e2ef0d3a50e698192ba182d53dbcc9186542df06 
  3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp bd5bc7372fafb1aba757ac08acceeb9689e2fc09 
  3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp c582d7084747f4f1804cc554cc544c8bc02602ac 

Diff: https://reviews.apache.org/r/12951/diff/


Testing
-------

make check


Thanks,

Ben Mahler


Re: Review Request 12951: Fixed JSON::Number output precision, and added a test.

Posted by Ben Mahler <be...@gmail.com>.

> On July 30, 2013, 4:59 p.m., Benjamin Hindman wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp, line 165
> > <https://reviews.apache.org/r/12951/diff/1/?file=327960#file327960line165>
> >
> >     Yes, my intuition tells me we'll want to omit them if not present.

The problem is that people will rely on the JSON format.

For example, with resource monitoring information, users may rely on "cpus_user_time_secs" being present in the output.
However, it is sometimes not available (e.g. on OS X with insufficient permissions) and will thus be not set in the protobuf message.
This means they'll have to know which JSON fields are optional and handle them being omitted. So for now I'll leave as is.


- Ben


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


On July 25, 2013, 10:05 p.m., Ben Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/12951/
> -----------------------------------------------------------
> 
> (Updated July 25, 2013, 10:05 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Vinod Kone.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> JSON::Number was output using a precision of 10 digits, whereas double precision guarantees 15 digits of accuracy.
> 
> Digits 16 and 17 may be bogus, so kept it at 15. See: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2005.pdf
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp e2ef0d3a50e698192ba182d53dbcc9186542df06 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp bd5bc7372fafb1aba757ac08acceeb9689e2fc09 
>   3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp c582d7084747f4f1804cc554cc544c8bc02602ac 
> 
> Diff: https://reviews.apache.org/r/12951/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Ben Mahler
> 
>


Re: Review Request 12951: Fixed JSON::Number output precision, and added a test.

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/12951/#review24247
-----------------------------------------------------------

Ship it!



3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp
<https://reviews.apache.org/r/12951/#comment48055>

    Yes, my intuition tells me we'll want to omit them if not present.


- Benjamin Hindman


On July 25, 2013, 10:05 p.m., Ben Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/12951/
> -----------------------------------------------------------
> 
> (Updated July 25, 2013, 10:05 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Vinod Kone.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> JSON::Number was output using a precision of 10 digits, whereas double precision guarantees 15 digits of accuracy.
> 
> Digits 16 and 17 may be bogus, so kept it at 15. See: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2005.pdf
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/json.hpp e2ef0d3a50e698192ba182d53dbcc9186542df06 
>   3rdparty/libprocess/3rdparty/stout/include/stout/protobuf.hpp bd5bc7372fafb1aba757ac08acceeb9689e2fc09 
>   3rdparty/libprocess/3rdparty/stout/tests/json_tests.cpp c582d7084747f4f1804cc554cc544c8bc02602ac 
> 
> Diff: https://reviews.apache.org/r/12951/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Ben Mahler
> 
>