diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-05-25 22:22:25 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:02 -0400 |
commit | 65bc41090720cdc249c1b0b9b9b8a8f062b41268 (patch) | |
tree | bbbe6c8d8cd02026e3896e938dae686f74dea812 /fs/bcachefs/util.c | |
parent | aab5e0972a32790c0dbfac64929529820114c674 (diff) | |
download | linux-stable-65bc41090720cdc249c1b0b9b9b8a8f062b41268.tar.gz linux-stable-65bc41090720cdc249c1b0b9b9b8a8f062b41268.tar.bz2 linux-stable-65bc41090720cdc249c1b0b9b9b8a8f062b41268.zip |
mean and variance: More tests
Add some more tests that test conventional and weighted mean
simultaneously, and with a table of values that represents events that
we'll be using this to look for so we can verify-by-eyeball that the
output looks sane.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/util.c')
-rw-r--r-- | fs/bcachefs/util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index e0c93da2523f..6374d8aa9afc 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -350,7 +350,7 @@ static inline void bch2_time_stats_update_one(struct bch2_time_stats *stats, if (time_after64(end, start)) { duration = end - start; - stats->duration_stats = mean_and_variance_update(stats->duration_stats, duration); + mean_and_variance_update(&stats->duration_stats, duration); mean_and_variance_weighted_update(&stats->duration_stats_weighted, duration); stats->max_duration = max(stats->max_duration, duration); stats->min_duration = min(stats->min_duration, duration); @@ -359,7 +359,7 @@ static inline void bch2_time_stats_update_one(struct bch2_time_stats *stats, if (time_after64(end, stats->last_event)) { freq = end - stats->last_event; - stats->freq_stats = mean_and_variance_update(stats->freq_stats, freq); + mean_and_variance_update(&stats->freq_stats, freq); mean_and_variance_weighted_update(&stats->freq_stats_weighted, freq); stats->max_freq = max(stats->max_freq, freq); stats->min_freq = min(stats->min_freq, freq); |