[VOL-4073] Updated voltha-physical-soak-dt-tests jobs to get cpu usage by container

Change-Id: I45f04641f4de809a5b18a02c564df0e5048a67b5
diff --git a/jjb/pipeline/voltha/master/voltha-physical-soak-dt-tests.groovy b/jjb/pipeline/voltha/master/voltha-physical-soak-dt-tests.groovy
index 5918e4d..320bdf6 100644
--- a/jjb/pipeline/voltha/master/voltha-physical-soak-dt-tests.groovy
+++ b/jjb/pipeline/voltha/master/voltha-physical-soak-dt-tests.groovy
@@ -23,6 +23,8 @@
   deployment_config = null
 }
 
+def volthaNamespace = "voltha"
+
 pipeline {
   /* no label, executor is determined by JJB */
   agent {
@@ -142,6 +144,8 @@
       }
       steps {
         sh """
+        JENKINS_NODE_COOKIE="dontKillMe" _TAG="prometheus" bash -c "while true; do kubectl port-forward --address 0.0.0.0 -n cattle-prometheus svc/access-prometheus 31301:80; done"&
+        ps aux | grep port-forward
         mkdir -p $ROBOT_LOGS_DIR
         if [ "${params.testType}" == "Functional" ]; then
             if ( ${powerSwitch} ); then
@@ -230,7 +234,15 @@
         unstableThreshold: 0,
         onlyCritical: true
         ]);
-      archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.tgz,*.txt,pods/*.txt'
+      // get cpu usage by container
+      sh '''
+      mkdir -p $WORKSPACE/plots || true
+      cd $WORKSPACE/voltha-system-tests
+      source ./vst_venv/bin/activate || true
+      sleep 60 # we have to wait for prometheus to collect all the information
+      python scripts/sizing.py -o $WORKSPACE/plots -a 0.0.0.0:31301 -n ${volthaNamespace} -s 7200 || true
+      '''
+      archiveArtifacts artifacts: '**/*.log,**/*.gz,**/*.tgz,*.txt,pods/*.txt,plots/*'
     }
   }
 }