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

Commit 99e8b72

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

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

busybot/deploy.yaml

Lines changed: 2 additions & 2 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:

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)