summaryrefslogtreecommitdiff
path: root/lib/tests/igt_stats.c
AgeCommit message (Collapse)Author
2015-07-19igt/stats: Fixup tests to compile after interface changesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-27stats: Exercise the reallocation pathsDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Spwan igt_init_with_size() from igt_init()Damien Lespiau
It's all about good looking APIs. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Test we do correctly invalidate the sorted arrayDamien Lespiau
Chris had a doubt, and I was lazy and didn't do a similar test for the quartiles/median than for the mean (test_invalidate_mean()). Plug that gap. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Add support for the interquartile range (IQR)Damien Lespiau
IQR is a good measure of dispersion. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Add support for quartiles (and thus median)Damien Lespiau
More stuff, quite useful characteristics of a dataset. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Use igt_assert_eq_double() when asserting on doublesDamien Lespiau
Lucky enough to have exact values, == works! Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Add igt_stats_get_range()Damien Lespiau
Somewhat useful, for instance to size an histogram. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Add functions to retrieve min/max values of the datasetDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Factor out a fixture to initialize statsDamien Lespiau
We're going to use this simple fixture once more, might as well make a function instead of copy/pasting code. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Add a getter for the population propertyDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Add a way to specify if the data set is a population or a sampleDamien Lespiau
This changes how we compute the variance. We want an unbiased variance when reasoning about a sample. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Zero the whole structure at init() timeDamien Lespiau
Because the structure started small, I initialized every member directly, but that means that the new fields added weren't properly initialized (sigh!). Zero the whole thing first then. Also, the punishment for introducing a bug should be to write the corresponding unit test. It's not a perfect one, but I'll take it. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27tests/stats: Make sure we properly invalidate the cached meanDamien Lespiau
Sure, that's an implementation details, but make sure we do recompute the mean when we add a new value. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Add a way to retrieve the standard deviationDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27tests/igt_stats: Call igt_stats_fini() to not leak the arrayDamien Lespiau
Sure, it'll be freed at exit(), but might as well be a bit pedantic. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Be more precise and talk about mean, not averageDamien Lespiau
There are several types of averages eg. mean, median and mode. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-25lib: Add a tiny utility function to compute averagesDamien Lespiau
The master plan would be to get a bit more stats in it, at least the standard deviation and confidence interval. Just need the average for now. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>