/**
* Sum of squares of all datastore delays ever observed (in ms). Note that
* delays above 64k ms are excluded (to avoid overflow within
* first 4 billion requests).
*/
uint64_t cummulative_squared_delay;
/**
* Sum of squares of all datastore delays ever observed (in ms). Note that
* delays above 64k ms are excluded (to avoid overflow within
* first 4 billion requests).
*/
uint64_t cummulative_squared_delay;
/**
* Total number of requests included in the cummulative datastore delay values.
*/
uint64_t cummulative_request_count;
/**
* Total number of requests included in the cummulative datastore delay values.
*/
uint64_t cummulative_request_count;
/**
* Current running average datastore delay. Its relation to the
* average datastore delay and it std. dev. (as calcualted from the
/**
* Current running average datastore delay. Its relation to the
* average datastore delay and it std. dev. (as calcualted from the
- if (load->autodecline.value == 0)
- {
- load->runavg_delay = 0.0;
- load->load = 0;
- return;
- }
- n = delta.value / load->autodecline.value;
+ if (load->autodecline.rel_value == 0)
+ {
+ load->runavg_delay = 0.0;
+ load->load = 0;
+ return;
+ }
+ n = delta.rel_value / load->autodecline.rel_value;
if (load->cummulative_request_count <= 1)
return;
/* calcuate std dev of latency; we have for n values of "i" that:
if (load->cummulative_request_count <= 1)
return;
/* calcuate std dev of latency; we have for n values of "i" that:
-
- avg = (sum val_i) / n
- stddev = (sum (val_i - avg)^2) / (n-1)
- = (sum (val_i^2 - 2 avg val_i + avg^2) / (n-1)
- = (sum (val_i^2) - 2 avg sum (val_i) + n * avg^2) / (n-1)
- */
+ *
+ * avg = (sum val_i) / n
+ * stddev = (sum (val_i - avg)^2) / (n-1)
+ * = (sum (val_i^2 - 2 avg val_i + avg^2) / (n-1)
+ * = (sum (val_i^2) - 2 avg sum (val_i) + n * avg^2) / (n-1)
+ */