*****************************************************************************
* rrd_hw.c : Support for Holt-Winters Smoothing/ Aberrant Behavior Detection
*****************************************************************************
* Initial version by Jake Brutlag, WebTV Networks, 5/1/00
*****************************************************************************/
*****************************************************************************
* rrd_hw.c : Support for Holt-Winters Smoothing/ Aberrant Behavior Detection
*****************************************************************************
* Initial version by Jake Brutlag, WebTV Networks, 5/1/00
*****************************************************************************/
- offset = floor(0.025 * row_count);
+ if (atoi(rrd->stat_head->version) >= 4) {
+ offset = floor(rrd->rra_def[rra_idx].
+ par[RRA_seasonal_smoothing_window].
+ u_val / 2 * row_count);
+ } else {
+ offset = floor(0.05 / 2 * row_count);
+ }
+
/* could read all data in a single block, but we need to
* check for NA values */
for (i = 0; i < row_count; ++i) {
/* could read all data in a single block, but we need to
* check for NA values */
for (i = 0; i < row_count; ++i) {
if (rrd_seek(rrd_file, sizeof(stat_head_t) +
rrd->stat_head->ds_cnt * sizeof(ds_def_t) +
rrd->stat_head->rra_cnt * sizeof(rra_def_t) +
if (rrd_seek(rrd_file, sizeof(stat_head_t) +
rrd->stat_head->ds_cnt * sizeof(ds_def_t) +
rrd->stat_head->rra_cnt * sizeof(rra_def_t) +
if (rrd_seek(rrd_file, rra_start, SEEK_SET)) {
rrd_set_error("apply_smoother: seek to pos %d failed", rra_start);
free(rrd_values);
if (rrd_seek(rrd_file, rra_start, SEEK_SET)) {
rrd_set_error("apply_smoother: seek to pos %d failed", rra_start);
free(rrd_values);
hw_multiplicative_init_seasonality,
hw_calculate_seasonal_deviation,
hw_init_seasonal_deviation,
hw_multiplicative_init_seasonality,
hw_calculate_seasonal_deviation,
hw_init_seasonal_deviation,
hw_additive_init_seasonality,
hw_calculate_seasonal_deviation,
hw_init_seasonal_deviation,
hw_additive_init_seasonality,
hw_calculate_seasonal_deviation,
hw_init_seasonal_deviation,