The problem:
I have a set of time readings taken at regular intervals. I dont want to store and sort all the values, but I'd like to form a sensible statistical representation of them as they come in.
The standard deviation shows they are not normally distributed.
Sample data below.
I guess this is easy but my brain is addled; I'm finding the max and min values like this:
if (pingTime > pingMax) pingMax = pingTime;
if (pingTime < pingMin) pingMin = pingTime;
what I'm looking for is a way to find the SECOND largest, SECOND smallest, and the median.
Presently they are floats, in milliseconds, but I'm happy to use ints.
They are ping times so the mean and standard deviation dont seem to be a sensible way to represent them.
pingstats pingTime; 23.87; jitter; 46.73
pingstats pingTime; 105.69; jitter; 35.09
pingstats pingTime; 23.08; jitter; 47.52
pingstats pingTime; 104.32; jitter; 33.72
pingstats pingTime; 116.13; jitter; 45.53
pingstats pingTime; 34.76; jitter; 35.84
pingstats pingTime; 4.32; jitter; 66.28
pingstats pingTime; 26.82; jitter; 43.78
pingstats pingTime; 96.89; jitter; 26.29
pingstats pingTime; 118.99; jitter; 48.39
pingMax is 216 pingMin is 4
sumJitter; 429.15 ;pingSamples; 10.00 ;pJitter ; 42.92
sumPing; 654.88 ;sumPing2; 62133.70 ;pingAvNew ;68.04 ;sTemp 42886.32 ;sTemp2; 1924.74 ;sigma; 43.87 ;jitter; 42.92
dont worry about the reported computed results seeming "wrong":
here pingMax and pingMin are hourly values, and pingAv New is geometrically filtered.
the jitter is the difference between the actual ping time and pingAvNew.