static inline void
ss_avgupdate(ssavg *a, uint32_t v)
{
a->count++;
a->total += v;
a->avg = (double)a->total / (double)a->count;
if (v < a->min) // v will never be less than 0 therefore this always false
a->min = v;
if (v > a->max)
a->max = v;
}
this should be something like:
if (v < a->min || a->min == -1)
a->min = v;
So that the first time the a->min is initialized with the first value.
Hi,
The min latency is always 0.
I think the issue is here: https://github.com/pmwkaa/sophia/blob/73f5bc64a5239d6ea70e550e166674cb1b38a678/sophia/std/ss_avg.h#L27
and the update function here: https://github.com/pmwkaa/sophia/blob/73f5bc64a5239d6ea70e550e166674cb1b38a678/sophia/std/ss_avg.h#L38
this should be something like:
So that the first time the
a->min
is initialized with the first value.