Created
April 22, 2019 16:26
-
-
Save groundnuty/a10291492949de877ba26086ccdb44ea to your computer and use it in GitHub Desktop.
Benchmarking of k8s deployment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while IFS=',' read -r name sched ready compl initf ; do | |
name=$(echo $name | cut -d= -f2) ; | |
ready=$(echo $ready | cut -d= -f2); | |
sched=$(echo $sched | cut -d= -f2) ; | |
compl=$(echo $compl | cut -d= -f2) ; | |
initf=$(echo $initf | cut -d= -f2) ; | |
[ "$initf" = "null" ] && initf="" ; | |
s=$sched; | |
e=$ready; | |
[ "$initf" != "" ] && s=$initf ; | |
[ "$compl" != "" ] && e=$compl ; | |
#echo "$name\t$sched\t$ready\t$compl\t$initf\t$(datediff $s $e) " ; | |
echo "$name\t$(datediff $s $e) " ; | |
done < <(kubectl get pods -o json | jq -jr '.items[] | "name=","\(.metadata.name)",",scheduled=\(.status.conditions[] | select(.type == "PodScheduled") | .lastTransitionTime)",",ready=","\(.status.conditions[] | select(.type == "Ready") | .lastTransitionTime)",",completed=","\(.status.conditions[] | select((.type == "Initialized") and (.reason == "PodCompleted")) | .lastTransitionTime)",",initsFinished=","\(.status.initContainerStatuses[-1].state.terminated.finishedAt)\n"') | column -t |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment