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
05f48bde
Commit
05f48bde
authored
8 years ago
by
Christian Dietrich
Browse files
Options
Downloads
Patches
Plain Diff
record the number of misses and hits
parent
5a5e607a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
experiments/analyze_results.py
+35
-1
35 additions, 1 deletion
experiments/analyze_results.py
with
35 additions
and
1 deletion
experiments/analyze_results.py
+
35
−
1
View file @
05f48bde
...
@@ -91,9 +91,44 @@ class AnalyzeResults(Experiment):
...
@@ -91,9 +91,44 @@ class AnalyzeResults(Experiment):
for
(
project
,
results
)
in
groupby
(
x
,
key
=
lambda
x
:
x
.
project_name
()):
for
(
project
,
results
)
in
groupby
(
x
,
key
=
lambda
x
:
x
.
project_name
()):
times
=
defaultdict
(
lambda
:
dict
())
times
=
defaultdict
(
lambda
:
dict
())
for
result
in
sorted
(
results
,
key
=
lambda
x
:
x
.
variant_name
()):
for
result
in
sorted
(
results
,
key
=
lambda
x
:
x
.
variant_name
()):
key
=
[
result
.
variant_name
(),
'
historical
'
]
records
=
eval
(
result
.
stats
.
value
)
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
=
[]
build_times
=
[]
failed
=
0
failed
=
0
for
build
in
records
[
'
builds
'
]:
for
build
in
records
[
'
builds
'
]:
...
@@ -111,7 +146,6 @@ class AnalyzeResults(Experiment):
...
@@ -111,7 +146,6 @@ class AnalyzeResults(Experiment):
self
.
save
(
key
+
[
"
count
"
],
len
(
seq
))
self
.
save
(
key
+
[
"
count
"
],
len
(
seq
))
self
.
save
(
key
+
[
"
avg
"
],
np
.
average
(
seq
))
self
.
save
(
key
+
[
"
avg
"
],
np
.
average
(
seq
))
key
=
[
result
.
variant_name
(),
'
historical
'
]
self
.
save
(
key
+
[
"
failed
"
],
failed
)
self
.
save
(
key
+
[
"
failed
"
],
failed
)
seq
(
key
,
build_times
)
seq
(
key
,
build_times
)
...
...
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