Lines Matching defs:stats
5 void update_stats(struct stats *stats, u64 val)
9 stats->n++;
10 delta = val - stats->mean;
11 stats->mean += delta / stats->n;
12 stats->M2 += delta*(val - stats->mean);
14 if (val > stats->max)
15 stats->max = val;
17 if (val < stats->min)
18 stats->min = val;
21 double avg_stats(struct stats *stats)
23 return stats->mean;
42 double stddev_stats(struct stats *stats)
46 if (stats->n < 2)
49 variance = stats->M2 / (stats->n - 1);
50 variance_mean = variance / stats->n;