[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 {
diff --git a/jjb/voltha-scale.yaml b/jjb/voltha-scale.yaml
index 86707af..27cc403 100644
--- a/jjb/voltha-scale.yaml
+++ b/jjb/voltha-scale.yaml
@@ -299,6 +299,7 @@
           atomixReplicas: 3
           kafkaReplicas: 3
           etcdReplicas: 3
+          openonuAdapterReplicas: 8
           topologies: 1-16-16, 1-16-32, 2-16-32
 
 # list of parameters for the VOLTHA Jobs,
@@ -739,6 +740,7 @@
     atomixReplicas: 0
     kafkaReplicas: 1
     etcdReplicas: 1
+    openonuAdapterReplicas: 1
     topologies: 1-1-1, 1-2-2, 2-2-2
 
     project-type: pipeline
@@ -788,6 +790,11 @@
           description: 'How many ETCD instances to run'
 
       - string:
+          name: openonuAdapterReplicas
+          default: '{openonuAdapterReplicas}'
+          description: 'How many OpenONU adapter instances to run'
+
+      - string:
           name: topologies
           default: '{topologies}'
           description: 'Topologies configuration, comma separate list of "olt-pon-onu" eg: "1-16-16, 1-16-32"'