benchmark/test
Roman Lebedev a271c36af9 Drop Stat1, refactor statistics to be user-providable, add median. (#428)
* Drop Stat1, refactor statistics to be user-providable, add median.

My main goal was to add median statistic. Since Stat1
calculated the stats incrementally, and did not store
the values themselves, it is was not possible. Thus,
i have replaced Stat1 with simple std::vector<double>,
containing all the values.

Then, i have refactored current mean/stdev to be a
function that is provided with values vector, and
returns the statistic. While there, it seemed to make
sense to deduplicate the code by storing all the
statistics functions in a map, and then simply iterate
over it. And the interface to add new statistics is
intentionally exposed, so they may be added easily.

The notable change is that Iterations are no longer
displayed as 0 for stdev. Is could be changed, but
i'm not sure how to nicely fit that into the API.

Similarly, this dance about sometimes (for some fields,
for some statistics) dividing by run.iterations, and
then multiplying the calculated stastic back is also
dropped, and if you do the math, i fail to see why
it was needed there in the first place.

Since that was the only use of stat.h, it is removed.

* complexity.h: attempt to fix MSVC build

* Update README.md

* Store statistics to compute in a vector, ensures ordering.

* Add a bit more tests for repetitions.

* Partially address review notes.

* Fix gcc build: drop extra ';'

clang, why didn't you warn me?

* Address review comments.

* double() -> 0.0
* early return
2017-08-23 16:44:29 -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 User counters: add more unit tests. ... 2017-04-27 22:11:40 +01:00
CMakeLists.txt Suppress -Wodr on C++03 tests when LTO is enabled. 2017-07-30 18:44:04 -06:00
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 Add user-defined counters. (#262) 2017-03-01 17:23:42 -07:00
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 Fix #342: DoNotOptimize causes compile errors on older GCC versions. (#398) 2017-06-02 15:47:23 -07:00
filter_test.cc Simplify clang-format and apply to tests (#302) 2016-10-07 11:04:50 -07:00
fixture_test.cc Simplify clang-format and apply to tests (#302) 2016-10-07 11:04:50 -07:00
map_test.cc Simplify clang-format and apply to tests (#302) 2016-10-07 11:04:50 -07:00
multiple_ranges_test.cc Simplify clang-format and apply to tests (#302) 2016-10-07 11:04:50 -07:00
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 Improve some comments. 2017-05-01 23:02:35 +01:00
output_test_helper.cc Trying again to fix error caused by -Wunused-function. 2017-05-03 00:05:15 +01:00
register_benchmark_test.cc Add ClearRegisteredBenchmark() function. (#402) 2017-06-14 09:16:53 -07:00
reporter_output_test.cc Drop Stat1, refactor statistics to be user-providable, add median. (#428) 2017-08-23 16:44:29 -07:00
skip_with_error_test.cc Simplify clang-format and apply to tests (#302) 2016-10-07 11:04:50 -07:00
user_counters_tabular_test.cc reporter_output_test: json: iterations is int, not float (#431) 2017-07-31 19:04:02 -06:00
user_counters_test.cc reporter_output_test: json: iterations is int, not float (#431) 2017-07-31 19:04:02 -06:00