[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] djm-logparser: include very simple stats about actions and reasons
Holger Levsen (@holger)
gitlab at salsa.debian.org
Mon Apr 3 20:57:10 BST 2023
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
ddd8e480 by Holger Levsen at 2023-04-03T21:56:53+02:00
djm-logparser: include very simple stats about actions and reasons
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
2 changed files:
- bin/djm-logparser
- bin/reproducible_common.sh
Changes:
=====================================
bin/djm-logparser
=====================================
@@ -25,13 +25,30 @@ LOGMONTH="$(date -u '+%Y-%m')"
TOTAL=$(grep -c $LOGMONTH $LOGFILE)
HOURS=$(cut -b 1-13 $LOGFILE | sort -u | wc -l)
HOSTS=$(cut -d ',' -f2 $LOGFILE | sort -u | wc -l)
-# number of reboots per month
-# number of job debugging sessions per month
-# ...
+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
-echo "Amount of djm actions done: $TOTAL"
-echo "Amount of hours with djm usage: $HOURS"
-echo "Amount of hosts maintained: $HOSTS"
-
+echo "Amount of djm actions done: $TOTAL"
+echo "Amount of hours with djm usage: $HOURS"
+echo "Amount of hosts maintained: $HOSTS"
+echo "----------------------------------------------------"
+
+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)
+ echo "Amount of $grep_action actions done: $AMOUNT / $TOTAL = $PERCENT%"
+done
+echo "----------------------------------------------------"
+
+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)
+ echo "Amount of $grep_reason reasons done: $AMOUNT / $TOTAL = $PERCENT%"
+done
+echo "----------------------------------------------------"
+
+# todo: sort actions and reasons by highest amount
=====================================
bin/reproducible_common.sh
=====================================
@@ -124,7 +124,7 @@ if $DEBUG ; then
set -x
fi
-# some cmomon logging functions
+# some common logging functions
log_info () {
_log "I:" "$@"
}
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/ddd8e480e78b2d2deae7d22070fa1365b5aaaab1
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/ddd8e480e78b2d2deae7d22070fa1365b5aaaab1
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20230403/68cf6b8a/attachment-0001.htm>
More information about the Qa-jenkins-scm
mailing list