CSIT-1041: Trending dashboard 62/11862/1
authorTibor Frank <tifrank@cisco.com>
Wed, 18 Apr 2018 04:47:52 +0000 (06:47 +0200)
committerTibor Frank <tifrank@cisco.com>
Wed, 18 Apr 2018 04:49:45 +0000 (06:49 +0200)
Change-Id: I98db049e4a8a3fedce73290815cf84e7d281f6ec
Signed-off-by: Tibor Frank <tifrank@cisco.com>
resources/tools/presentation/generator_CPTA.py

index c3784e9..9ec196c 100644 (file)
@@ -165,13 +165,15 @@ def _evaluate_results(in_data, trimmed_data, window=10):
     if len(in_data) > 2:
         win_size = in_data.size if in_data.size < window else window
         results = [0.0, ]
-        median = in_data.rolling(window=win_size).median()
+        median = in_data.rolling(window=win_size, min_periods=2).median()
         stdev_t = trimmed_data.rolling(window=win_size, min_periods=2).std()
         m_vals = median.values
         s_vals = stdev_t.values
         d_vals = in_data.values
+        t_vals = trimmed_data.values
         for day in range(1, in_data.size):
-            if np.isnan(m_vals[day]) \
+            if np.isnan(t_vals[day]) \
+                    or np.isnan(m_vals[day]) \
                     or np.isnan(s_vals[day]) \
                     or np.isnan(d_vals[day]):
                 results.append(0.0)

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.