Merge "[VOL-2992] - Using profiler images in VOLTHA scale profiling job - Collecting .pprof files for later consumption - Archiving tests, plots and pprof results"
diff --git a/jjb/pipeline/voltha-scale-test.groovy b/jjb/pipeline/voltha-scale-test.groovy
index 7fa69de..675bfb9 100644
--- a/jjb/pipeline/voltha-scale-test.groovy
+++ b/jjb/pipeline/voltha-scale-test.groovy
@@ -306,6 +306,26 @@
           fi
         fi
       '''
+      // get some data from pprof
+      sh '''
+      if [ ${withProfiling} = true ] ; then
+        curl -o $WORKSPACE/logs/pprof/rw-core-goroutine.pprof http://127.0.0.1:6060/debug/pprof/goroutine
+        curl -o $WORKSPACE/logs/pprof/rw-core-heap.pprof http://127.0.0.1:6060/debug/pprof/heap
+        curl -o $WORKSPACE/logs/pprof/rw-core-threadcreate.pprof http://127.0.0.1:6060/debug/pprof/threadcreate
+        curl -o $WORKSPACE/logs/pprof/rw-core-block.pprof http://127.0.0.1:6060/debug/pprof/block
+        curl -o $WORKSPACE/logs/pprof/rw-core-mutex.pprof http://127.0.0.1:6060/debug/pprof/mutex
+        curl -o $WORKSPACE/logs/pprof/rw-core-profile.pprof http://127.0.0.1:6060/debug/pprof/profile
+        curl -o $WORKSPACE/logs/pprof/rw-core-trace.trace http://127.0.0.1:6060/debug/pprof/trace?minutes=10
+
+        curl -o $WORKSPACE/logs/pprof/openolt-goroutine.pprof http://127.0.0.1:6061/debug/pprof/goroutine
+        curl -o $WORKSPACE/logs/pprof/openolt-heap.pprof http://127.0.0.1:6061/debug/pprof/heap
+        curl -o $WORKSPACE/logs/pprof/openolt-threadcreate.pprof http://127.0.0.1:6061/debug/pprof/threadcreate
+        curl -o $WORKSPACE/logs/pprof/openolt-block.pprof http://127.0.0.1:6061/debug/pprof/block
+        curl -o $WORKSPACE/logs/pprof/openolt-mutex.pprof http://127.0.0.1:6061/debug/pprof/mutex
+        curl -o $WORKSPACE/logs/pprof/openolt-profile.pprof http://127.0.0.1:6061/debug/pprof/profile
+        curl -o $WORKSPACE/logs/pprof/openolt-trace.trace http://127.0.0.1:6061/debug/pprof/trace?minutes=10
+      fi
+      '''
       plot([
         csvFileName: 'scale-test.csv',
         csvSeries: [
@@ -398,7 +418,7 @@
         kubectl logs -l app=bbsim > $WORKSPACE/logs/bbsim-logs.logs
         kubectl logs -l app=onos > $WORKSPACE/logs/onos-logs.logs
       '''
-      archiveArtifacts artifacts: 'kind-voltha/install-minimal.log,execution-time.txt,logs/*,logs/pprof/*.png'
+      archiveArtifacts artifacts: 'kind-voltha/install-minimal.log,execution-time.txt,logs/*,logs/pprof/*,RobotLogs/*,plots/*.txt'
     }
   }
 }
diff --git a/jjb/voltha-scale.yaml b/jjb/voltha-scale.yaml
index b181d40..2d261db 100644
--- a/jjb/voltha-scale.yaml
+++ b/jjb/voltha-scale.yaml
@@ -74,6 +74,8 @@
           withIgmp: false
           withProfiling: true
           extraHelmFlags: '--set profiler.enabled=true '
+          rwCoreImg: voltha/voltha-rw-core:master-profile
+          openoltAdapterImg:  voltha/voltha-openolt-adapter:master-profile
 
       # jobs for 512 ONUs with a 8 openonu-adapters and clustered ONOS
       - 'voltha-scale-measurements':