Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
dCache
cta
Commits
b6b7f0c6
Commit
b6b7f0c6
authored
6 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[log-analysis] Amends CI scripts for new log format
parent
dc43cdb0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
continuousintegration/log_analysis/CI/preprocess.sh
+50
-30
50 additions, 30 deletions
continuousintegration/log_analysis/CI/preprocess.sh
continuousintegration/log_analysis/CI/process_log_events.sh
+3
-1
3 additions, 1 deletion
continuousintegration/log_analysis/CI/process_log_events.sh
with
53 additions
and
31 deletions
continuousintegration/log_analysis/CI/preprocess.sh
+
50
−
30
View file @
b6b7f0c6
...
...
@@ -70,22 +70,32 @@ process_frontend_log()
{
echoc
$LT_BLUE
"Extracting archive log messages from cta-frontend..."
awk
-vDATE_OFFSET
=
"
$DATE_OFFSET
"
'
awk
-vDATE_OFFSET
=
"
$DATE_OFFSET
"
-vYEAR
=
$(
date
+%y
)
'
function processLine(event, logline) {
sub(" .* fileId=\"", " ", logline)
sub("\".*$", "", logline)
sub("^20", "", logline)
sub("T", " ", logline)
gsub("-", "", logline)
gsub("+[0-9:]* ", " ", logline)
split(logline,logarray)
DAYS=logarray[1]-DATE_OFFSET
HOURS=substr(logarray[2],1,2)
MINS=substr(logarray[2],4,2)
SECS=substr(logarray[2],7,2)
MSECS=substr(logarray[2],10)
sub("^Jan ", YEAR "01", logline)
sub("^Feb ", YEAR "02", logline)
sub("^Mar ", YEAR "03", logline)
sub("^Apr ", YEAR "04", logline)
sub("^May ", YEAR "05", logline)
sub("^Jun ", YEAR "06", logline)
sub("^Jul ", YEAR "07", logline)
sub("^Aug ", YEAR "08", logline)
sub("^Sep ", YEAR "09", logline)
sub("^Oct ", YEAR "10", logline)
sub("^Nov ", YEAR "11", logline)
sub("^Dec ", YEAR "12", logline)
DATE=substr(logline,1,6)
gsub(" ", "0", DATE)
DAYS=DATE-DATE_OFFSET
HOURS=substr(logline,8,2)
MINS=substr(logline,11,2)
SECS=substr(logline,14,2)
MSECS=substr(logline,17,6)
timesecs=((DAYS*24 + HOURS)*60 + MINS)*60 + SECS
print logarray[3],event,timesecs "." MSECS
FILEID_LOC=index(logline, " fileId=\"")
FILEID=substr(logline,FILEID_LOC+9)
FILEID=substr(FILEID,1,index(FILEID, "\"")-1)
print FILEID,event,timesecs "." MSECS
}
/CREATE/ { processLine("CRE", $0) }
...
...
@@ -102,8 +112,8 @@ process_frontend_log()
process_file_ids
()
{
echoc
$LT_BLUE
"Extracting disk IDs and archive IDs from cta-frontend..."
grep
${
TEST_RUN
}
${
FRONTEND_LOG
}
|
\
grep
processCREATE |
\
grep
-F
${
TEST_RUN
}
${
FRONTEND_LOG
}
|
\
grep
-F
processCREATE |
\
sed
's/^.*diskFileId="//'
|
\
sed
's/" diskFilePath="/ /'
|
\
sed
's/" fileId="/ /'
|
\
...
...
@@ -119,22 +129,32 @@ process_taped_log()
{
echoc
$LT_BLUE
"Extracting archive log messages from cta-taped..."
awk
-vDATE_OFFSET
=
"
$DATE_OFFSET
"
'
awk
-vDATE_OFFSET
=
"
$DATE_OFFSET
"
-vYEAR
=
$(
date
+%y
)
'
function processLine(event, logline) {
sub(" .* fileId=\"", " ", logline)
sub("\".*$", "", logline)
sub("^20", "", logline)
sub("T", " ", logline)
gsub("-", "", logline)
gsub("+[0-9:]* ", " ", logline)
split(logline,logarray)
DAYS=logarray[1]-DATE_OFFSET
HOURS=substr(logarray[2],1,2)
MINS=substr(logarray[2],4,2)
SECS=substr(logarray[2],7,2)
MSECS=substr(logarray[2],10)
sub("^Jan ", YEAR "01", logline)
sub("^Feb ", YEAR "02", logline)
sub("^Mar ", YEAR "03", logline)
sub("^Apr ", YEAR "04", logline)
sub("^May ", YEAR "05", logline)
sub("^Jun ", YEAR "06", logline)
sub("^Jul ", YEAR "07", logline)
sub("^Aug ", YEAR "08", logline)
sub("^Sep ", YEAR "09", logline)
sub("^Oct ", YEAR "10", logline)
sub("^Nov ", YEAR "11", logline)
sub("^Dec ", YEAR "12", logline)
DATE=substr(logline,1,6)
gsub(" ", "0", DATE)
DAYS=DATE-DATE_OFFSET
HOURS=substr(logline,8,2)
MINS=substr(logline,11,2)
SECS=substr(logline,14,2)
MSECS=substr(logline,17,6)
timesecs=((DAYS*24 + HOURS)*60 + MINS)*60 + SECS
print logarray[3],event,timesecs "." MSECS
FILEID_LOC=index(logline, " fileId=\"")
FILEID=substr(logline,FILEID_LOC+9)
FILEID=substr(FILEID,1,index(FILEID, "\"")-1)
print FILEID,event,timesecs "." MSECS
}
/In ArchiveMount::getNextJobBatch\(\): popped one job/ { processLine("A_POP", $0) }
...
...
This diff is collapsed.
Click to expand it.
continuousintegration/log_analysis/CI/process_log_events.sh
+
3
−
1
View file @
b6b7f0c6
...
...
@@ -21,7 +21,9 @@ TAPED_LOG=${ARTEFACT_HOME}/tpsrv01/taped/cta/cta-taped.log
EOS_PATH
=
$(
grep
"Creating test dir in eos:"
${
ARTEFACT_HOME
}
/systests.sh.log |
cut
-d
' '
-f6
)
# Create temporary working directory
TMPDIR
=
/tmp/
$(
basename
${
0
}
)
.
$$
#TMPDIR=/tmp/$(basename ${0}).$$
TMPDIR
=
/tmp/logevents
rm
-rf
${
TMPDIR
}
mkdir
-p
${
TMPDIR
}
cd
${
TMPDIR
}
...
...
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