--- /dev/null
+#!/bin/bash
+cd $WORKSPACE
+
+data_file="results.txt"
+data_file_headers="Creating openroadm anchors with large data,Read datatrees using openroadm root,Update 100 data nodes,Batch delete 100 whole lists"
+
+if [[ ! -f "$data_file" ]]; then
+ echo "Creating $data_file"
+ touch "$data_file"
+ echo "$data_file_headers" > $data_file
+else
+ echo "$data_file already exists"
+fi
+
+echo "-----------------------------------------------------------------------------------"
+echo "-----------------------------------------------------------------------------------"
+# Extracting data results from performance job
+JENKINS_JOB_URL="https://jenkins.nordix.org/job/onap-cps-master-performance-test-java"
+latest_build=$(curl -s "${JENKINS_JOB_URL}/lastBuild/api/json" | jq -r '.number')
+echo "latest build is $latest_build"
+
+# Get the latest build status
+latest_build_status=$(curl -s "${JENKINS_JOB_URL}/api/json" | jq -r '.color')
+echo "latest build status is $latest_build_status"
+
+# Construct the URL for getting the console text
+CONSOLE_URL="${JENKINS_JOB_URL}/${latest_build}/consoleText"
+
+# Get the console text
+console_text=$(curl -s "$CONSOLE_URL")
+
+echo "-----------------------------------------------------------------------------------"
+echo "-----------------------------------------------------------------------------------"
+
+# Text patterns to match in console log
+creating_bookstore_pattern="^.*Creating openroadm anchors with large.*"
+read_datatreees_pattern="^.*Read datatrees using openroadm root.*"
+update_datanodes_pattern="^.*Update 100 data nodes.*"
+batch_delete_pattern="^.*Batch delete 100 whole lists.*"
+
+all_patterns=("$creating_bookstore_pattern" "$read_datatreees_pattern" "$update_datanodes_pattern" "$batch_delete_pattern")
+new_data=""
+
+# Extract numerical values as data results
+for pattern in "${all_patterns[@]}"; do
+ if matched_line=$(echo "$console_text" | grep -o -P "$pattern"); then
+ echo "Matched line: $matched_line"
+ limit_value=$(echo "$matched_line" | grep -o -P 'limit\s*\K\d+(,\d+)?' | tr -cd '[:digit:]')
+ took_value=$(echo "$matched_line" | grep -o -P 'took\s*\K\d+(,\d+)?' | tr -cd '[:digit:]')
+ percentage=$((took_value * 100 / limit_value))
+
+ echo "Limit value: $limit_value"
+ echo "Took value: $took_value"
+ echo "Percentage: $percentage"
+
+ if [ -z "$new_data" ]; then
+ new_data="$percentage"
+ else
+ new_data+=",$percentage"
+ fi
+ echo "New data: $new_data"
+
+ else
+ echo "No match found."
+ fi
+done
+echo "-----------------------------------------------------------------------------------"
+echo "-----------------------------------------------------------------------------------"
+
+
+# Publish results in file for building plot
+if [ -z "$new_data" ]; then
+ echo "No new data"
+else
+ echo "$new_data" >> $data_file
+fi
\ No newline at end of file
- shell:
!include-raw-escape: ./verify-jobs.sh
-# A job to perform CSIT on policy components
+# A job to perform CSIT on policy components
- job-template:
name: 'onap-{project-name}-{stream}-policy-csit-verify-java'
disabled_job_var: false
- string:
name: CSIT_NAME
default: '{csit-name}'
- description: The name of the csit-test to run
+ description: The name of the csit-test to run
- string:
name: SUBDIRECTORY
default: '{subdirectory}'
!include-raw-escape: ./verify-jobs.sh
- shell:
!include-raw-escape: ./verify-policy-csit.sh
+
+- job-template:
+ name: 'onap-{project-name}-performance-tests-plots'
+ disabled_job_var: false
+ node: onap-ubuntu1804
+
+ builders:
+ - shell:
+ !include-raw-escape: ./cps/prepare-performance-tests-data.sh
+
+ publishers:
+ - plot:
+ - title: "performance"
+ group: "performance"
+ csvFileName: "results.txt"
+ style: line
+ exclude-zero-yaxis: true
+ num-builds: '30'
+ series:
+ - file:
+ url: 'results.txt'
+ inclusion-flag: 'off'
+ display-table: false
+ format: csv
+
- job-template:
name: 'onap-{project-name}-{stream}-performance-test-java'
disabled_job_var: false
- shell:
!include-raw-escape: ./verify-jobs.sh
+ post-build:
+ - project: onap-cps-performance-tests-plots
# csits for diferent projects are different so need to have special handling
- job-template: