|
@@ -6,6 +6,7 @@
|
|
|
struct stats
|
|
struct stats
|
|
|
{
|
|
{
|
|
|
double n, mean, M2;
|
|
double n, mean, M2;
|
|
|
|
|
+ u64 max, min;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
void update_stats(struct stats *stats, u64 val);
|
|
void update_stats(struct stats *stats, u64 val);
|
|
@@ -13,4 +14,12 @@ double avg_stats(struct stats *stats);
|
|
|
double stddev_stats(struct stats *stats);
|
|
double stddev_stats(struct stats *stats);
|
|
|
double rel_stddev_stats(double stddev, double avg);
|
|
double rel_stddev_stats(double stddev, double avg);
|
|
|
|
|
|
|
|
|
|
+static inline void init_stats(struct stats *stats)
|
|
|
|
|
+{
|
|
|
|
|
+ stats->n = 0.0;
|
|
|
|
|
+ stats->mean = 0.0;
|
|
|
|
|
+ stats->M2 = 0.0;
|
|
|
|
|
+ stats->min = (u64) -1;
|
|
|
|
|
+ stats->max = 0;
|
|
|
|
|
+}
|
|
|
#endif
|
|
#endif
|