[VOL-3619] Aggregating stats in the matrix scale job

Change-Id: I1ccbe0ded204ee4ae29a30f56a9ac69227ee1f92
diff --git a/jjb/pipeline/voltha-scale-matrix.groovy b/jjb/pipeline/voltha-scale-matrix.groovy
index 8d35c2b..db4998d 100644
--- a/jjb/pipeline/voltha-scale-matrix.groovy
+++ b/jjb/pipeline/voltha-scale-matrix.groovy
@@ -48,7 +48,7 @@
     WITH_IGMP="no"
 
     // infrastructure size
-    NUM_OF_OPENONU=1
+    NUM_OF_OPENONU="${openonuAdapterReplicas}"
     NUM_OF_ONOS="${onosReplicas}"
     NUM_OF_ATOMIX="${atomixReplicas}"
     NUM_OF_KAFKA="${kafkaReplicas}"
@@ -156,6 +156,22 @@
           repeat_deploy_and_test(topologies)
       }
     }
+    stage('Aggregate stats') {
+      steps {
+        sh returnStdout: false, script: """
+        export IN_FOLDER=$WORKSPACE/stats/
+        export OUT_FOLDER=$WORKSPACE/plots/
+        mkdir -p \$OUT_FOLDER
+        cd $WORKSPACE/voltha-system-tests
+        make vst_venv
+        source ./vst_venv/bin/activate
+
+        sleep 60 # we have to wait for prometheus to collect all the information
+
+        python tests/scale/stats-aggregation.py -i \$IN_FOLDER -o \$OUT_FOLDER || true
+        """
+      }
+    }
   }
   post {
     always {