Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simcha van Collem
Iris
Commits
66bb3579
Commit
66bb3579
authored
9 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
start work on a build-times visualizer
parent
bc2298c3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
benchmark/.gitignore
+2
-0
2 additions, 0 deletions
benchmark/.gitignore
benchmark/gitlab-extract.py
+2
-1
2 additions, 1 deletion
benchmark/gitlab-extract.py
benchmark/parse_log.py
+38
-0
38 additions, 0 deletions
benchmark/parse_log.py
benchmark/visualize.py
+20
-0
20 additions, 0 deletions
benchmark/visualize.py
with
62 additions
and
1 deletion
benchmark/.gitignore
0 → 100644
+
2
−
0
View file @
66bb3579
__pycache__
build-times.log
This diff is collapsed.
Click to expand it.
benchmark/gitlab-extract.py
+
2
−
1
View file @
66bb3579
#!/usr/bin/env python3
#!/usr/bin/env python3
import
argparse
,
pprint
,
subprocess
,
sys
import
argparse
,
pprint
,
subprocess
,
sys
import
requests
import
requests
import
parse_log
def
first
(
it
):
def
first
(
it
):
for
i
in
it
:
for
i
in
it
:
...
@@ -12,7 +13,7 @@ def req(path):
...
@@ -12,7 +13,7 @@ def req(path):
return
requests
.
get
(
url
,
headers
=
{
'
PRIVATE-TOKEN
'
:
args
.
private_token
})
return
requests
.
get
(
url
,
headers
=
{
'
PRIVATE-TOKEN
'
:
args
.
private_token
})
# read command-line arguments
# read command-line arguments
parser
=
argparse
.
ArgumentParser
(
description
=
'
Update and build a bunch of stuff
'
)
parser
=
argparse
.
ArgumentParser
(
description
=
'
Extract iris-coq build logs from GitLab
'
)
parser
.
add_argument
(
"
-t
"
,
"
--private-token
"
,
parser
.
add_argument
(
"
-t
"
,
"
--private-token
"
,
dest
=
"
private_token
"
,
required
=
True
,
dest
=
"
private_token
"
,
required
=
True
,
help
=
"
The private token used to authenticate access.
"
)
help
=
"
The private token used to authenticate access.
"
)
...
...
This diff is collapsed.
Click to expand it.
benchmark/parse_log.py
0 → 100644
+
38
−
0
View file @
66bb3579
import
re
class
Result
:
def
__init__
(
self
,
commit
,
times
):
self
.
commit
=
commit
self
.
times
=
times
def
parse
(
file
,
filter
):
'''
[file] should be a file-like object, an iterator over the lines. filter should support
"
in
"
queries.
yields a list of Result objects giving the times of those Coq files that are
"
in
"
filter.
'''
commit_re
=
re
.
compile
(
"
^# ([a-z0-9]+)$
"
)
time_re
=
re
.
compile
(
"
^([a-zA-Z0-9_/-]+) \(user: ([0-9.]+) mem: ([0-9]+) ko\)$
"
)
commit
=
None
times
=
None
for
line
in
file
:
# next commit?
m
=
commit_re
.
match
(
line
)
if
m
is
not
None
:
# previous commit, if any, is done now
if
times
is
not
None
:
yield
Result
(
commit
,
times
)
# start recording next commit
commit
=
m
.
group
(
1
)
times
=
{}
# reset the recorded times
continue
# next file time?
m
=
time_re
.
match
(
line
)
if
m
is
not
None
:
name
=
m
.
group
(
1
)
time
=
float
(
m
.
group
(
2
))
if
name
in
filter
:
times
[
name
]
=
time
continue
# nothing else we know about
raise
Exception
(
"
Unexpected line: {}
"
.
format
(
line
))
# end of file. previous commit, if any, is done now.
if
times
is
not
None
:
yield
Result
(
commit
,
times
)
This diff is collapsed.
Click to expand it.
benchmark/visualize.py
0 → 100755
+
20
−
0
View file @
66bb3579
#!/usr/bin/env python3
import
argparse
,
sys
,
pprint
import
parse_log
# read command-line arguments
parser
=
argparse
.
ArgumentParser
(
description
=
'
Visualize iris-coq build times
'
)
parser
.
add_argument
(
"
-f
"
,
"
--file
"
,
dest
=
"
file
"
,
required
=
True
,
help
=
"
Filename to get the data from.
"
)
parser
.
add_argument
(
"
-t
"
,
"
--timings
"
,
nargs
=
'
+
'
,
dest
=
"
timings
"
,
help
=
"
The names of the Coq files (without the extension) whose timings should be extracted
"
)
args
=
parser
.
parse_args
()
pp
=
pprint
.
PrettyPrinter
()
log_file
=
sys
.
stdin
if
args
.
file
==
"
-
"
else
open
(
args
.
file
,
"
r
"
)
for
result
in
parse_log
.
parse
(
log_file
,
args
.
timings
):
pp
.
pprint
(
result
.
commit
)
pp
.
pprint
(
result
.
times
)
print
()
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