removed c++ comments //
[rrdtool.git] / src / rrd_hw.c
index 98333e2..ec4bbfa 100644 (file)
@@ -139,7 +139,14 @@ int apply_smoother(
     rrd_value_t *working_average;
     rrd_value_t *baseline;
 
-    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);
+    }
+
     if (offset == 0)
         return 0;       /* no smoothing */
 
@@ -415,7 +422,7 @@ int update_aberrant_CF(
         hw_multiplicative_init_seasonality,
         hw_calculate_seasonal_deviation,
         hw_init_seasonal_deviation,
-        1.0             // identity value
+        1.0             /* identity value */
     };
 
     static hw_functions_t hw_additive_functions = {
@@ -426,7 +433,7 @@ int update_aberrant_CF(
         hw_additive_init_seasonality,
         hw_calculate_seasonal_deviation,
         hw_init_seasonal_deviation,
-        0.0             // identity value 
+        0.0             /* identity value  */
     };
 
     rrd->cdp_prep[cdp_idx].scratch[CDP_scratch_idx].u_val = pdp_val;