Skip to content
Snippets Groups Projects
Commit 63b29e66 authored by Holger Levsen's avatar Holger Levsen
Browse files

djm-logparser: more refactoring

parent 7c680bfb
No related branches found
No related tags found
No related merge requests found
......@@ -27,24 +27,29 @@ seperator() {
# main
#
HOSTS=$(cut -d ',' -f2 $LOGFILE | sort -u | wc -l)
TOTAL=$(grep -c $LOGMONTH $LOGFILE)
HOURS=$(cut -b 1-13 $LOGFILE | sort -u | wc -l)
HOSTS=$(cut -d ',' -f2 $LOGFILE | sort -u | wc -l)
ACTIONS=$(cut -d ',' -f3 $LOGFILE |sort -u|sed -s "s# #_#g")
REASONS=$(cut -d ',' -f4 $LOGFILE |sort -u|sed -s "s# #_#g")
echo "Still very simple statistics for djm logs at $LOGFILE in $LOGMONTH"
echo
printf "$TWO_C" "hosts maintained:" "$HOSTS"
printf "$TWO_C" "djm actions done:" "$TOTAL"
echo "djm = documented jenkins maintenance"
echo " jenkins.debian.net exists since 2012, djm since 2023-04"
echo " so expect changes for some time."
echo
echo
printf "$TWO_C" "djm actions:" "$TOTAL"
printf "$TWO_C" "hours with djm usage:" "$HOURS"
printf "$TWO_C" "hosts maintained:" "$HOSTS"
seperator
for action in $ACTIONS ; do
grep_action="$(echo $action | sed -s 's#_# #g' | xargs echo)"
AMOUNT=$(cut -d ',' -f3 $LOGFILE |grep "$grep_action"|wc -l)
PERCENT=$(echo "scale=2 ; $AMOUNT/$TOTAL*100"|bc||echo 0)
printf "$THREE_C" "$grep_action actions done:" "$PERCENT%" "($AMOUNT / $TOTAL)"
printf "$THREE_C" "$grep_action actions:" "$PERCENT%" "($AMOUNT / $TOTAL)"
done
seperator
......@@ -52,8 +57,9 @@ for reason in $REASONS ; do
grep_reason="$(echo $reason | sed -s 's#_# #g' | xargs echo)"
AMOUNT=$(cut -d ',' -f4 $LOGFILE |grep "$grep_reason"|wc -l)
PERCENT=$(echo "scale=2 ; $AMOUNT/$TOTAL*100"|bc||echo 0)
printf "$THREE_C" "$grep_reason reasons done:" "$PERCENT%" "($AMOUNT / $TOTAL)"
printf "$THREE_C" "$grep_reason reasons:" "$PERCENT%" "($AMOUNT / $TOTAL)"
done
seperator
# todo: sort actions and reasons by highest amount
# todo: include the number of reproducible related jenkins jobs
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment