benchmark/test
Roman Lebedev b9be142d1e Json reporter: don't cast floating-point to int; adjust tooling (#426)
* Json reporter: passthrough fp, don't cast it to int; adjust tooling

Json output format is generally meant for further processing
using some automated tools. Thus, it makes sense not to
intentionally limit the precision of the values contained
in the report.

As it can be seen, FormatKV() for doubles, used %.2f format,
which was meant to preserve at least some of the precision.
However, before that function is ever called, the doubles
were already cast to the integer via RoundDouble()...

This is also the case for console reporter, where it makes
sense because the screen space is limited, and this reporter,
however the CSV reporter does output some( decimal digits.

Thus i can only conclude that the loss of the precision
was not really considered, so i have decided to adjust the
code of the json reporter to output the full fp precision.

There can be several reasons why that is the right thing
to do, the bigger the time_unit used, the greater the
precision loss, so i'd say any sort of further processing
(like e.g. tools/compare_bench.py does) is best done
on the values with most precision.

Also, that cast skewed the data away from zero, which
i think may or may not result in false- positives/negatives
in the output of tools/compare_bench.py

* Json reporter: FormatKV(double): address review note

* tools/gbench/report.py: skip benchmarks with different time units

While it may be useful to teach it to operate on the
measurements with different time units, which is now
possible since floats are stored, and not the integers,
but for now at least doing such a sanity-checking
is better than providing misinformation.
2017-07-24 16:13:55 -07:00
..
basic_test.cc Make Benchmark a single header library (but not header-only) (#407) 2017-07-04 16:31:47 -06:00
benchmark_test.cc
CMakeLists.txt
complexity_test.cc Json reporter: don't cast floating-point to int; adjust tooling (#426) 2017-07-24 16:13:55 -07:00
cxx03_test.cc
diagnostics_test.cc Make Benchmark a single header library (but not header-only) (#407) 2017-07-04 16:31:47 -06:00
donotoptimize_test.cc
filter_test.cc
fixture_test.cc
map_test.cc
multiple_ranges_test.cc
options_test.cc Make Benchmark a single header library (but not header-only) (#407) 2017-07-04 16:31:47 -06:00
output_test.h
output_test_helper.cc
register_benchmark_test.cc Add ClearRegisteredBenchmark() function. (#402) 2017-06-14 09:16:53 -07:00
reporter_output_test.cc Json reporter: don't cast floating-point to int; adjust tooling (#426) 2017-07-24 16:13:55 -07:00
skip_with_error_test.cc
user_counters_tabular_test.cc Json reporter: don't cast floating-point to int; adjust tooling (#426) 2017-07-24 16:13:55 -07:00
user_counters_test.cc Json reporter: don't cast floating-point to int; adjust tooling (#426) 2017-07-24 16:13:55 -07:00