Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
clang-hash
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Christian Dietrich
clang-hash
Commits
7899e778
There was a problem fetching the pipeline summary.
Commit
7899e778
authored
Aug 31, 2016
by
Ludwig Fueracker
Browse files
Options
Downloads
Patches
Plain Diff
added build time histograms
parent
893ed9c3
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
validate_hashes.py
+91
-1
91 additions, 1 deletion
validate_hashes.py
with
91 additions
and
1 deletion
validate_hashes.py
+
91
−
1
View file @
7899e778
...
...
@@ -8,6 +8,7 @@ import time
import
matplotlib.pyplot
as
plt
import
matplotlib.patches
as
mpatches
import
numpy
as
np
import
matplotlib.mlab
as
mlab
FULLRECORDFILENAME
=
"
/../fullRecord.info
"
...
...
@@ -207,6 +208,7 @@ def makeBuildTimeGraph(fullRecord):
totalHashDuration
=
0
# ns
for
filename
in
currentFiles
:
if
tr
(
'
ast-hash
'
)
not
in
currentFiles
[
filename
].
keys
():
#TODO: s.u., fix!
continue
if
filename
not
in
prevFiles
:
continue
...
...
@@ -280,6 +282,92 @@ def makeBuildTimeGraph(fullRecord):
fig
.
savefig
(
pathToRecords
+
'
/../buildTimeComposition.png
'
,
bbox_extra_artists
=
(
lgd
,),
bbox_inches
=
'
tight
'
)
################################################################################
def
makeTimeHistograms
(
fullRecord
):
#TODO: for parsing, hashing, compiling
sortedCommitIDs
=
getSortedCommitIDList
(
fullRecord
)
iterCommits
=
iter
(
sortedCommitIDs
)
prevCommit
=
fullRecord
[
next
(
iterCommits
)]
#TODO: den ersten commit auch behandeln!!!
parseTimes
=
[]
hashTimes
=
[]
compileTimes
=
[]
currentFiles
=
prevCommit
[
tr
(
'
files
'
)]
for
filename
in
currentFiles
:
if
tr
(
'
ast-hash
'
)
not
in
currentFiles
[
filename
].
keys
():
print
"
error: missing AST hash for file %s
"
%
filename
continue
parseTime
=
currentFiles
[
filename
][
tr
(
'
parse-duration
'
)]
/
1e6
# ns to ms
parseTimes
.
append
(
parseTime
)
hashTime
=
currentFiles
[
filename
][
tr
(
'
hash-duration
'
)]
/
1e6
hashTimes
.
append
(
hashTime
)
compileTime
=
currentFiles
[
filename
][
tr
(
'
compile-duration
'
)]
/
1e6
compileTimes
.
append
(
compileTime
)
for
commitID
in
iterCommits
:
currentCommit
=
fullRecord
[
commitID
]
currentFiles
=
currentCommit
[
tr
(
'
files
'
)]
prevFiles
=
prevCommit
[
tr
(
'
files
'
)]
for
filename
in
currentFiles
:
if
tr
(
'
ast-hash
'
)
not
in
currentFiles
[
filename
].
keys
():
print
"
error: missing AST hash for file %s
"
%
filename
continue
if
filename
not
in
prevFiles
:
continue
currentRecord
=
currentFiles
[
filename
]
prevRecord
=
prevFiles
[
filename
]
if
prevRecord
[
tr
(
'
object-hash
'
)]
!=
currentRecord
[
tr
(
'
object-hash
'
)]:
parseTime
=
currentFiles
[
filename
][
tr
(
'
parse-duration
'
)]
/
1e6
# ns to ms
parseTimes
.
append
(
parseTime
)
hashTime
=
currentFiles
[
filename
][
tr
(
'
hash-duration
'
)]
/
1e6
hashTimes
.
append
(
hashTime
)
compileTime
=
currentFiles
[
filename
][
tr
(
'
compile-duration
'
)]
/
1e6
compileTimes
.
append
(
compileTime
)
#TODO: understand params and vars
hist
,
bins
=
np
.
histogram
(
parseTimes
,
bins
=
50
)
width
=
0.7
*
(
bins
[
1
]
-
bins
[
0
])
center
=
(
bins
[:
-
1
]
+
bins
[
1
:])
/
2
fig
,
ax
=
plt
.
subplots
()
plt
.
xlabel
(
'
time
'
)
plt
.
ylabel
(
'
#files
'
)
ax
.
bar
(
center
,
hist
,
align
=
'
center
'
,
width
=
width
)
fig
.
savefig
(
pathToRecords
+
'
/../parseTimeHistogram.png
'
)
#, bbox_extra_artists=(lgd,), bbox_inche s='tight')
hist
,
bins
=
np
.
histogram
(
hashTimes
,
bins
=
50
)
width
=
0.7
*
(
bins
[
1
]
-
bins
[
0
])
center
=
(
bins
[:
-
1
]
+
bins
[
1
:])
/
2
fig
,
ax
=
plt
.
subplots
()
plt
.
xlabel
(
'
time
'
)
plt
.
ylabel
(
'
#files
'
)
ax
.
bar
(
center
,
hist
,
align
=
'
center
'
,
width
=
width
)
fig
.
savefig
(
pathToRecords
+
'
/../hashTimeHistogram.png
'
)
#, bbox_extra_artists=(lgd,), bbox_inche s='tight')
hist
,
bins
=
np
.
histogram
(
compileTimes
,
bins
=
50
)
width
=
0.7
*
(
bins
[
1
]
-
bins
[
0
])
center
=
(
bins
[:
-
1
]
+
bins
[
1
:])
/
2
fig
,
ax
=
plt
.
subplots
()
plt
.
xlabel
(
'
time
'
)
plt
.
ylabel
(
'
#files
'
)
ax
.
bar
(
center
,
hist
,
align
=
'
center
'
,
width
=
width
)
fig
.
savefig
(
pathToRecords
+
'
/../compileTimeHistogram.png
'
)
#, bbox_extra_artists=(lgd,), bbox_inche s='tight')
################################################################################
...
...
@@ -297,7 +385,6 @@ def makeChangesGraph(fullRecord):
# f_changes.write("%s;%s;%s;%s\n" % ("commitHash", "differentAstHash", "differentObjHash", "same"))
for
commitID
in
iterCommits
:
currentCommit
=
fullRecord
[
commitID
]
currentFiles
=
currentCommit
[
tr
(
'
files
'
)]
prevFiles
=
prevCommit
[
tr
(
'
files
'
)]
...
...
@@ -370,6 +457,9 @@ if (len(sys.argv) > 1):
makeBuildTimeGraph
(
fullRecord
)
print
"
finished BuildTimeGraph at %s
"
%
time
.
ctime
()
makeTimeHistograms
(
fullRecord
)
print
"
finished timeHistograms at %s
"
%
time
.
ctime
()
makeChangesGraph
(
fullRecord
)
print
"
finished ChangesGraph at %s
"
%
time
.
ctime
()
...
...
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
sign in
to comment