diff options
author | Daniel Hill <daniel@gluo.nz> | 2022-08-11 23:03:28 +0200 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:43 +0200 |
commit | bf8f8b20a1e729170493d99a2014c90c5cf5b84b (patch) | |
tree | 8e5c118e09a4ad8427c38312c24a27d5daf0853f /fs/bcachefs/util.h | |
parent | bcachefs: Mean and variance (diff) | |
download | linux-bf8f8b20a1e729170493d99a2014c90c5cf5b84b.tar.xz linux-bf8f8b20a1e729170493d99a2014c90c5cf5b84b.zip |
bcachefs: time stats now uses the mean_and_variance module.
Signed-off-by: Daniel Hill <daniel@gluo.nz>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/util.h')
-rw-r--r-- | fs/bcachefs/util.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h index 3b0090faef4d..4243a22c766c 100644 --- a/fs/bcachefs/util.h +++ b/fs/bcachefs/util.h @@ -18,6 +18,8 @@ #include <linux/vmalloc.h> #include <linux/workqueue.h> +#include "mean_and_variance.h" + struct closure; #ifdef CONFIG_BCACHEFS_DEBUG @@ -407,14 +409,18 @@ struct bch2_time_stat_buffer { struct bch2_time_stats { spinlock_t lock; - u64 count; /* all fields are in nanoseconds */ - u64 average_duration; - u64 average_frequency; u64 max_duration; + u64 min_duration; + u64 max_freq; + u64 min_freq; u64 last_event; struct bch2_quantiles quantiles; + struct mean_and_variance duration_stats; + struct mean_and_variance_weighted duration_stats_weighted; + struct mean_and_variance freq_stats; + struct mean_and_variance_weighted freq_stats_weighted; struct bch2_time_stat_buffer __percpu *buffer; }; |