Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
busybot: use script to get results
Browse files Browse the repository at this point in the history
Signed-off-by: Zuhair AlSader <zuhair@koor.tech>
  • Loading branch information
zalsader committed Nov 15, 2023
1 parent 0d545d3 commit 481195f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 5 additions & 4 deletions busybot/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ metadata:
namespace: busybot
spec:
schedule: "* * * * *"
successfulJobsHistoryLimit: 5
successfulJobsHistoryLimit: 10
failedJobsHistoryLimit: 5
concurrencyPolicy: Forbid
concurrencyPolicy: Replace
jobTemplate:
metadata:
labels:
Expand Down Expand Up @@ -69,9 +69,10 @@ spec:
do
dd if=/dev/urandom of=/tmp/file bs=$SIZE count=1
md5=$(md5sum /tmp/file | awk '{ print $1 }')
filename=$(printf "%02d-%s" $file $md5)
filename=$(printf "%02d" $file)
echo Writing $filename
mv /tmp/file $STORE/$filename
rm -f $STORE/$filename-*
mv /tmp/file $STORE/$filename-$md5
done
# Delete $DEL_COUNT random files from store
Expand Down
10 changes: 10 additions & 0 deletions busybot/get_exec_times.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

IFS=" " read -r -a completionTimes <<< "$(kubectl get -n busybot jobs --field-selector status.successful=1 -o jsonpath='{.items[*].status.completionTime}')"
IFS=" " read -r -a startTimes <<< "$(kubectl get -n busybot jobs --field-selector status.successful=1 -o jsonpath='{.items[*].status.startTime}')"

for i in "${!completionTimes[@]}"; do
startTime=$(date --date "${startTimes[$i]}" +%s)
endTime=$(date --date "${completionTimes[$i]}" +%s)
echo "$((endTime - startTime))"
done

0 comments on commit 481195f

Please sign in to comment.