Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jenkins.debian.net
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debian QA
jenkins.debian.net
Commits
63b29e66
Commit
63b29e66
authored
2 years ago
by
Holger Levsen
Browse files
Options
Downloads
Patches
Plain Diff
djm-logparser: more refactoring
Signed-off-by:
Holger Levsen
<
holger@layer-acht.org
>
parent
7c680bfb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/djm-logparser
+11
-5
11 additions, 5 deletions
bin/djm-logparser
with
11 additions
and
5 deletions
bin/djm-logparser
+
11
−
5
View file @
63b29e66
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment