3 ms·
As a developer I rarely find the need for log scale, but I was recently analyzing performance data, specifically finding patterns where one operation deviated f
by atombender 2y ago
As a developer I rarely find the need for log scale, but I was recently analyzing performance data, specifically finding patterns where one operation deviated from the normal.
For example, if an operation usually takes around 20ms, I would want to know if that operation suddenly took 200ms (a factor of 10). But I wouldn't be interested in small deviations; 40ms, even if it's twice the original number, is this within the natural variance seen due to varying levels of load and so on. Conversely, if an operation normally takes 5,000ms, if it took 10s that would actually be terrible, and I really want to know if it exceeded, say, 6,000ms. In other words, the acceptable deviation is dependent on the scale of the original number.
So I ended up choosing a hand-tuned logarithmic function which multiplies the average with a constant divided by the logarithm of the average, the output being the upper bounds on how much deviation from the average we can tolerate. So the larger the number, the lower the tolerance in absolute (linear terms).