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=""
+JENKINS_JOB_URL="https://jenkins.nordix.org/job/onap-cps-master-performance-test-java"
# Get latest build
getLatestBuild() {
latestBuild=$(getLatestBuild)
consoleText=""
lastRecordedBuild=""
-dateOfLastRecordedBuild=""
-JENKINS_JOB_URL="https://jenkins.nordix.org/job/onap-cps-master-performance-test-java"
+timestampOfLastRecordedBuild=""
# Create and add header to the file
createAndAddHeader() {
fi
}
+# Get the console text from specific build of the performance job
getConsoleText() {
buildToRead=$1
consoleURL="${JENKINS_JOB_URL}/${buildToRead}/consoleText"
echo "New data added"
fi
lastRecordedBuild=$buildNumber
- dateOfLastRecordedBuild=$(curl -s "${JENKINS_JOB_URL}/${lastRecordedBuild}/api/json" | jq -r '.timestamp' | xargs -I {} date -d "@{}")
+ timestampOfLastRecordedBuild=$(curl -s "${JENKINS_JOB_URL}/${lastRecordedBuild}/api/json" | jq -r '.timestamp')
+ formattedTimestampOfLastBuild=$(date -d "@$((timestampOfLastRecordedBuild / 1000))" "+%B %e, %Y at %H:%M")
echo "last Recorded build: $lastRecordedBuild"
- echo "date of last recorded build: $dateOfLastRecordedBuild"
+ echo "date of last recorded build: $formattedTimestampOfLastBuild"
}
buildStaticReport() {
buildHTMLReport() {
- chartTitle1="$1"
- chartFileName1="$2" # Get the chart file name as the first parameter
+ chartTitle1="$1" # i.e Get the chart file name as the first parameter
+ chartFileName1="$2"
chartTitle2="$3"
chartFileName2="$4"
chartTitle4="$7"
chartFileName4="$8"
- reportTitle="$9" # Get the report title as the second parameter
+ reportTitle="$9" # i.e Get the report title as the ninth parameter
cat <<EOT > "index.html"
<!DOCTYPE html>
</head>
<body>
<h1 style="text-align: center;">$reportTitle</h1>
- <h4>Last recorded build number: $lastRecordedBuild</h4>
- <h4>Date of the last recoded build: $dateOfLastRecordedBuild</h4>
+ <h4>Last updated for performance job build no. $lastRecordedBuild on $formattedTimestampOfLastBuild</h4>
<table align="center">
<tr> <!-- First Row -->
<td align="center">
</head>
<body>
<h1>$reportTitle</h1>
- <h4>Last recorded build number: $lastRecordedBuild</h4>
- <h4>Date of the last recoded build: $dateOfLastRecordedBuild</h4>
+ <h4>Last updated for performance job build no. $lastRecordedBuild on $formattedTimestampOfLastBuild</h4>
<img src="$chartFileName" alt="Graph Image">
</body>
</html>
getLatestBuild
if [ -z "$(ls -A)" ]; then
# Calculate the starting value for the loop
- startValue=$((latestBuild - 70))
+ startValue=$((latestBuild - 100))
# Start the loop from startValue up to latestBuild
for ((i=startValue; i<=latestBuild; i++)); do