[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] djm-logparser: try to represent the time spent on lost focus
Holger Levsen (@holger)
gitlab at salsa.debian.org
Mon Apr 3 22:57:51 BST 2023
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
39933f0f by Holger Levsen at 2023-04-03T23:57:41+02:00
djm-logparser: try to represent the time spent on lost focus
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
2 changed files:
- bin/djm
- bin/djm-logparser
Changes:
=====================================
bin/djm
=====================================
@@ -15,7 +15,7 @@ set -o pipefail # see eg http://petereisentraut.blogspot.com/2010/11/pipefail.h
# define environment and parse parameters
#
-LOGFILE=~/.djm.log # TODO: write a parser for this logfile to generate statistics
+LOGFILE=~/.djm.log
TARGET=$1
ACTION=$2
REASON=$3
=====================================
bin/djm-logparser
=====================================
@@ -29,6 +29,9 @@ seperator() {
TOTAL=$(grep -c $LOGMONTH $LOGFILE)
HOURS=$(cut -b 1-13 $LOGFILE | sort -u | wc -l)
+TEN_MIN_SLICES=$(cut -b 1-15 $LOGFILE | sort -u | wc -l)
+TWENTY_MIN_SLICES=$(( TEN_MIN_SLICES + TEN_MIN_SLICES ))
+SLICES_AS_HOURS=$(echo "scale=2 ; $TWENTY_MIN_SLICES/3"|bc||echo 0)
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")
@@ -42,6 +45,9 @@ echo
echo
printf "$TWO_C" "djm actions:" "$TOTAL"
printf "$TWO_C" "hours with djm usage:" "$HOURS"
+printf "$TWO_C" " ten minute slices with djm usage:" "$TEN_MIN_SLICES"
+printf "$TWO_C" " twenty minute slices (because focus):" "$TWENTY_MIN_SLICES"
+printf "$TWO_C" " thoses slices as hours:" "$SLICES_AS_HOURS"
printf "$TWO_C" "hosts maintained:" "$HOSTS"
seperator
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/39933f0f818485f3753f1c093cd15ee56a4260cc
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/39933f0f818485f3753f1c093cd15ee56a4260cc
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/5a75de5b/attachment-0001.htm>
More information about the Qa-jenkins-scm
mailing list