Skip to content

Commit

Permalink
fix duration time
Browse files Browse the repository at this point in the history
Signed-off-by: bvolovat <[email protected]>
  • Loading branch information
bvolovat committed Feb 9, 2025
1 parent d1c72e3 commit b781313
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 20 deletions.
16 changes: 7 additions & 9 deletions collect-metrics-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ data:
echo "Starting setup_and_run.sh script..."
START_TIME=$(date +%s)
# Add early logging of duration
echo "Duration time set to: ${DURATION_TIME} minutes"
echo "Updating package list and installing required packages..."
apt-get update
apt-get install -y git curl apt-transport-https ca-certificates
Expand All @@ -36,14 +39,11 @@ data:
awk -F'/' '{print $NF}' | awk -F':' '{if ($2 ~ /^v/) print $1": "$2; else print $1": v"$2}' |
sort -u)
# Extract only one `node-agent` version (DaemonSet runs multiple instances)
# Extract only one `node-agent` version
NODE_AGENT_VERSION=$(echo "$IMAGE_VERSIONS" | grep "node-agent" | head -n 1)
WEBHOOK_URL="${WEBHOOK_URL}"
# Send Slack notification (Job Started)
# curl -X POST --data-urlencode "payload={\"channel\": \"C06AJ92GHLM\", \"username\": \"Performance-test\", \"icon_emoji\": \":rocket:\", \"text\": \"🚀 *Performance Test Started!* \nCluster: \`$CLUSTER_NAME\`\nHelm Chart: \`$HELM_VERSION\`\", \"attachments\": [{\"color\": \"#36a64f\", \"fields\": [{\"title\": \"Image Versions\", \"value\": \"\`\`\`$IMAGE_VERSIONS\`\`\`\", \"short\": false}], \"footer\": \"Kubernetes Cluster\", \"ts\": $(date +%s)}]}" $WEBHOOK_URL
echo "Installing Python dependencies..."
pip install --no-cache-dir requests pandas matplotlib plotly numpy
Expand All @@ -59,7 +59,6 @@ data:
git config --global user.name "bvolovat"
echo "Waiting for ${EXACT_DURATION} minutes before running tests..."
#
sleep $((EXACT_DURATION * 60))
END_TIME=$(date +%s)
Expand All @@ -80,9 +79,6 @@ data:
echo "Test execution complete."
# Send Slack notification (Job Finished)
# curl -X POST --data-urlencode "payload={\"channel\": \"C06AJ92GHLM\", \"username\": \"Performance-test\", \"icon_emoji\": \":white_check_mark:\", \"text\": \"✅ *Performance Test Completed!* \nCluster: \`$CLUSTER_NAME\`\nHelm Chart: \`$HELM_VERSION\`\nDuration: *${EXACT_DURATION} minutes*\", \"attachments\": [{\"color\": \"#36a64f\", \"fields\": [{\"title\": \"Image Versions\", \"value\": \"\`\`\`$IMAGE_VERSIONS\`\`\`\", \"short\": false}], \"footer\": \"Kubernetes Cluster\", \"ts\": $(date +%s)}]}" $WEBHOOK_URL
curl -X POST --data-urlencode "payload={
\"channel\": \"C06AJ92GHLM\",
\"username\": \"Performance-test\",
Expand Down Expand Up @@ -125,6 +121,8 @@ spec:
secretKeyRef:
name: perf-channel-webhook
key: url
- name: EXACT_DURATION
value: "$(DURATION_TIME)"
volumeMounts:
- name: run-script
mountPath: /scripts
Expand All @@ -142,4 +140,4 @@ spec:
name: run-script
defaultMode: 0777

restartPolicy: Never
restartPolicy: Never
4 changes: 0 additions & 4 deletions output/cpu_metrics.csv

This file was deleted.

4 changes: 0 additions & 4 deletions output/memory_metrics.csv

This file was deleted.

Binary file removed output/node-agent-cdj47_cpu_usage.png
Binary file not shown.
Binary file removed output/node-agent-cdj47_memory_usage.png
Binary file not shown.
Binary file removed output/node-agent-f5f84_cpu_usage.png
Binary file not shown.
Binary file removed output/node-agent-f5f84_memory_usage.png
Binary file not shown.
Binary file removed output/node-agent-r7s4j_cpu_usage.png
Binary file not shown.
Binary file removed output/node-agent-r7s4j_memory_usage.png
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit b781313

Please sign in to comment.