Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Open Source Software
Zipr Toolchain
Commits
42aeab57
Commit
42aeab57
authored
8 years ago
by
an7s
Browse files
Options
Downloads
Patches
Plain Diff
Add hostname to gathered stats
Former-commit-id: e053eacd7c33a2654c2f8ac1a874b1e29f432bd0
parent
0906f205
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tools/gather_stats.py
+10
-4
10 additions, 4 deletions
tools/gather_stats.py
tools/ps_analyze.sh
+2
-0
2 additions, 0 deletions
tools/ps_analyze.sh
with
12 additions
and
4 deletions
tools/gather_stats.py
+
10
−
4
View file @
42aeab57
...
...
@@ -23,15 +23,16 @@ def extract_attribute(attribute_line):
# get stats one file at a time
stats
=
{}
for
log_file_path
in
sys
.
argv
[
1
:]:
ps_analyze_log
=
False
log_file
=
os
.
path
.
basename
(
log_file_path
)
if
not
os
.
path
.
exists
(
log_file_path
):
continue
if
log_file
==
'
ps_analyze.log
'
:
contin
ue
ps_analyze_log
=
Tr
ue
step_name
=
os
.
path
.
splitext
(
log_file
)[
0
]
step_name
=
os
.
path
.
splitext
(
log_file
)[
0
]
with
open
(
log_file_path
,
'
r
'
)
as
f
:
for
line
in
f
:
...
...
@@ -39,11 +40,16 @@ for log_file_path in sys.argv[1:]:
if
not
line
or
line
is
None
:
continue
if
re
.
search
(
ATTRIBUTE
,
line
)
or
re
.
search
(
ATTRIBUTE2
,
line
):
if
ps_analyze_log
:
if
'
ATTRIBUTE start_time
'
in
line
or
'
ATTRIBUTE end_time
'
in
line
or
'
ATTRIBUTE hostname
'
in
line
:
(
attribute_name
,
attribute_value
)
=
extract_attribute
(
line
.
rstrip
())
if
not
step_name
in
stats
:
stats
[
step_name
]
=
{}
stats
[
step_name
][
attribute_name
]
=
attribute_value
elif
re
.
search
(
ATTRIBUTE
,
line
)
or
re
.
search
(
ATTRIBUTE2
,
line
):
(
attribute_name
,
attribute_value
)
=
extract_attribute
(
line
.
rstrip
())
if
not
step_name
in
stats
:
stats
[
step_name
]
=
{}
stats
[
step_name
][
attribute_name
]
=
attribute_value
if
stats
:
...
...
This diff is collapsed.
Click to expand it.
tools/ps_analyze.sh
+
2
−
0
View file @
42aeab57
...
...
@@ -583,8 +583,10 @@ report_logs()
{
logfile
=
logs/ps_analyze.log
myhost
=
$(
hostname
)
echo
"# ATTRIBUTE start_time=
$ps_starttime
"
>>
$logfile
echo
"# ATTRIBUTE end_time=
$ps_endtime
"
>>
$logfile
echo
"# ATTRIBUTE hostname=
$myhost
"
>>
$logfile
echo
"# ATTRIBUTE peasoup_step_name=all_peasoup"
>>
$logfile
for
i
in
$all_logs
...
...
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