Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Christian Dietrich
clang-hash
Commits
05f48bde
Commit
05f48bde
authored
Jan 30, 2017
by
Christian Dietrich
Browse files
record the number of misses and hits
parent
5a5e607a
Changes
1
Hide whitespace changes
Inline
Side-by-side
experiments/analyze_results.py
View file @
05f48bde
...
...
@@ -91,9 +91,44 @@ class AnalyzeResults(Experiment):
for
(
project
,
results
)
in
groupby
(
x
,
key
=
lambda
x
:
x
.
project_name
()):
times
=
defaultdict
(
lambda
:
dict
())
for
result
in
sorted
(
results
,
key
=
lambda
x
:
x
.
variant_name
()):
key
=
[
result
.
variant_name
(),
'historical'
]
records
=
eval
(
result
.
stats
.
value
)
# How Many Hits were produced by clang-hash/ccache
hits
=
0
misses
=
0
hash_hits
=
0
if
os
.
path
.
exists
(
result
.
clang_hash_stats
.
path
):
hash_hits
=
result
.
clang_hash_stats
.
value
.
count
(
"H"
)
hash_misses
=
result
.
clang_hash_stats
.
value
.
count
(
"M"
)
self
.
save
(
key
+
[
"hits"
,
"clang-hash"
],
hash_hits
)
self
.
save
(
key
+
[
"miss"
,
"clang-hash"
],
hash_misses
)
hits
+=
hash_hits
misses
+=
hash_misses
if
os
.
path
.
exists
(
result
.
ccache_stats
.
path
):
ccache_hits
=
0
ccache_misses
=
0
for
line
in
result
.
ccache_stats
.
value
.
split
(
"
\n
"
):
if
"cache hit"
in
line
:
ccache_hits
+=
int
(
line
[
line
.
index
(
")"
)
+
1
:].
strip
())
if
"cache miss"
in
line
:
ccache_misses
+=
int
(
line
[
line
.
index
(
"miss"
)
+
4
:].
strip
())
self
.
save
(
key
+
[
"hits"
,
"ccache"
],
ccache_hits
)
self
.
save
(
key
+
[
"misses"
,
"ccache"
],
ccache_misses
)
hits
+=
ccache_hits
misses
+=
(
ccache_misses
-
hash_hits
)
self
.
save
(
key
+
[
"hits"
],
hits
)
self
.
save
(
key
+
[
"misses"
],
misses
)
if
os
.
path
.
exists
(
result
.
ccache_stats
.
path
):
text
=
result
.
ccache_stats
.
value
build_times
=
[]
failed
=
0
for
build
in
records
[
'builds'
]:
...
...
@@ -111,7 +146,6 @@ class AnalyzeResults(Experiment):
self
.
save
(
key
+
[
"count"
],
len
(
seq
))
self
.
save
(
key
+
[
"avg"
],
np
.
average
(
seq
))
key
=
[
result
.
variant_name
(),
'historical'
]
self
.
save
(
key
+
[
"failed"
],
failed
)
seq
(
key
,
build_times
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment