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

Commit 481195f

Browse files
author
Zuhair AlSader
committed
busybot: use script to get results
Signed-off-by: Zuhair AlSader <[email protected]>
1 parent 0d545d3 commit 481195f

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

busybot/deploy.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ metadata:
2323
namespace: busybot
2424
spec:
2525
schedule: "* * * * *"
26-
successfulJobsHistoryLimit: 5
26+
successfulJobsHistoryLimit: 10
2727
failedJobsHistoryLimit: 5
28-
concurrencyPolicy: Forbid
28+
concurrencyPolicy: Replace
2929
jobTemplate:
3030
metadata:
3131
labels:
@@ -69,9 +69,10 @@ spec:
6969
do
7070
dd if=/dev/urandom of=/tmp/file bs=$SIZE count=1
7171
md5=$(md5sum /tmp/file | awk '{ print $1 }')
72-
filename=$(printf "%02d-%s" $file $md5)
72+
filename=$(printf "%02d" $file)
7373
echo Writing $filename
74-
mv /tmp/file $STORE/$filename
74+
rm -f $STORE/$filename-*
75+
mv /tmp/file $STORE/$filename-$md5
7576
done
7677
7778
# Delete $DEL_COUNT random files from store

busybot/get_exec_times.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
IFS=" " read -r -a completionTimes <<< "$(kubectl get -n busybot jobs --field-selector status.successful=1 -o jsonpath='{.items[*].status.completionTime}')"
4+
IFS=" " read -r -a startTimes <<< "$(kubectl get -n busybot jobs --field-selector status.successful=1 -o jsonpath='{.items[*].status.startTime}')"
5+
6+
for i in "${!completionTimes[@]}"; do
7+
startTime=$(date --date "${startTimes[$i]}" +%s)
8+
endTime=$(date --date "${completionTimes[$i]}" +%s)
9+
echo "$((endTime - startTime))"
10+
done

0 commit comments

Comments
 (0)