PAL trending: Trending line 93/11393/2
authorTibor Frank <tifrank@cisco.com>
Tue, 27 Mar 2018 08:29:52 +0000 (10:29 +0200)
committerTibor Frank <tifrank@cisco.com>
Tue, 27 Mar 2018 08:32:11 +0000 (08:32 +0000)
Change-Id: I46309f53365b9335fc93bcecdf293bca07a0e51d
Signed-off-by: Tibor Frank <tifrank@cisco.com>
resources/tools/presentation/generator_CPTA.py

index bca5535..0c317c0 100644 (file)
@@ -313,8 +313,9 @@ def _generate_trending_traces(in_data, period, moving_win_size=10,
     traces.append(trace_anomalies)
 
     if show_moving_median:
+        min_periods = moving_win_size / 2 + 1
         data_mean_y = pd.Series(data_y).rolling(
-            window=moving_win_size).median()
+            window=moving_win_size, min_periods=min_periods).median()
         trace_median = plgo.Scatter(
             x=data_x,
             y=data_mean_y,
@@ -324,7 +325,7 @@ def _generate_trending_traces(in_data, period, moving_win_size=10,
                 "width": 1,
                 "color": color,
             },
-            name='{name}-trend'.format(name=name, size=moving_win_size)
+            name='{name}-trend'.format(name=name)
         )
         traces.append(trace_median)
 
@@ -388,7 +389,7 @@ def _generate_all_charts(spec, input_data):
                         chart_data[test_name][int(idx)] = \
                             test["result"]["throughput"]
                     except (KeyError, TypeError):
-                        chart_data[test_name][int(idx)] = None
+                        pass
 
         # Add items to the csv table:
         for tst_name, tst_data in chart_data.items():

©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.