Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tsn-measures
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
tsn-measures
Commits
00039840
Commit
00039840
authored
Jun 01, 2020
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP
parent
6a1b2c3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
7 deletions
+31
-7
measure-analysis/measure-analysis.py
measure-analysis/measure-analysis.py
+31
-7
No files found.
measure-analysis/measure-analysis.py
View file @
00039840
...
...
@@ -77,34 +77,53 @@ class MeasureSetHandler:
def
generate_graphs
(
self
):
colors
=
[
'red'
,
'blue'
,
'green'
]
# List of colors to use to superimpose the different plots
colors
=
[
'red'
,
'blue'
,
'green'
,
'purple'
,
'yellow'
]
# For each type of measure set
for
mtype
in
self
.
measure_sets
:
# List all the measures of this type
measures
=
[]
for
mid
in
self
.
measure_sets
[
mtype
][
'ids'
]:
measures
.
append
(
self
.
get_measure_set
(
"{}{}"
.
format
(
mtype
,
mid
)))
if
len
(
measures
)
==
0
:
continue
# Get the type and number of properties, which are all identical for
# measures of the same type
props_type
=
measures
[
0
].
props_type
nb_props
=
len
(
measures
[
0
].
props
)
# For each property draw a graph
for
i
in
range
(
nb_props
):
prop_name
=
measures
[
0
].
props_names
[
i
]
# Superimpose all the different measures of the same type and property type
for
j
,
mid
in
enumerate
(
self
.
measure_sets
[
mtype
][
'ids'
]):
measure
=
self
.
get_measure_set
(
"{}{}"
.
format
(
mtype
,
mid
))
graph_name
=
"{}{}"
.
format
(
mtype
,
mid
)
measure
.
generate_histogram
(
i
,
colors
[
j
])
if
props_type
==
'histogram'
:
measure
.
generate_histogram
(
i
,
colors
[
j
])
else
:
measure
.
generate_chrono_graph
(
i
,
colors
[
j
])
fig
,
ax
=
plt
.
gcf
(),
plt
.
gca
()
ax
.
set_xlabel
(
'Latency (us)'
)
ax
.
set_ylabel
(
'Number of latency samples'
)
ax
.
set_title
(
'{}, {} histogram'
.
format
(
mtype
,
measures
[
0
].
props_names
[
i
]))
# Set meta graph information
if
props_type
==
'histogram'
:
ax
.
set_xlabel
(
'Latency (us)'
)
ax
.
set_ylabel
(
'Number of latency samples'
)
ax
.
set_title
(
'{}, {} histogram'
.
format
(
mtype
,
prop_name
))
else
:
ax
.
set_xlabel
(
'Time (us)'
)
ax
.
set_ylabel
(
prop_name
)
ax
.
set_title
(
'{}, {} graph'
.
format
(
mtype
,
prop_name
))
fig
.
set_size_inches
(
11.0
,
5.5
)
plt
.
savefig
(
"{}/{}{}.png"
.
format
(
MeasureSetHandler
.
graphs_dir
,
mtype
,
measures
[
0
].
props_names
[
i
]))
# Save the graph
plt
.
savefig
(
"{}/{}{}.png"
.
format
(
MeasureSetHandler
.
graphs_dir
,
mtype
,
props_name
))
def
generate_report
(
self
,
include_graphs
=
True
):
...
...
@@ -351,6 +370,11 @@ class MeasureSet:
if
self
.
props
[
i
][
j
]
>
0
and
height
<
min_height
:
patch
.
set_height
(
min_height
)
def
generate_chrono_graph
(
self
,
i
,
color
):
prop
=
self
.
props
[
i
]
x
=
[
i
for
i
in
range
(
len
(
prop
))]
plt
.
plot
(
x
,
prop
,
color
=
color
)
def
generate_table
(
self
,
headers
=
True
,
values
=
True
,
metadata_mask
=
[],
props_lens
=
[]):
if
headers
==
False
and
values
==
False
:
...
...
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