Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
0c4e10dd
Commit
0c4e10dd
authored
Mar 04, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
9eae441c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
39 deletions
+34
-39
go/neo/t/benchplot
go/neo/t/benchplot
+34
-39
No files found.
go/neo/t/benchplot
View file @
0c4e10dd
...
...
@@ -286,6 +286,7 @@ def labwarn(labels):
def
main
():
B
,
_
,
extv
=
xload_file
(
sys
.
argv
[
1
])
# extract neotest extension blocks with nodes
# extv -> node {}, date
nodemap
=
OrderedDict
()
date
=
None
...
...
@@ -301,22 +302,27 @@ def main():
if
'date'
in
ext
:
if
date
is
None
:
date
=
ext
[
'date'
]
# XXX also check dates on client/server are close enough to each other?
del
ext
[
'date'
]
# XXX if date = None -> warning "no date found"
if
date
is
None
:
date
=
"date: ?"
splitby
=
[
'dataset'
,
'cluster'
]
Bl
=
B
.
bylabel
(
splitby
)
Bl
=
B
.
bylabel
([
'dataset'
,
'cluster'
])
for
labkey
in
Bl
:
# FIXME hack
if
labkey
==
():
# cpu benchmarks
continue
_
=
dict
(
labkey
)
dataset
=
_
[
'dataset'
]
cluster
=
_
[
'cluster'
]
# check we have node info or nodes in cluster
for
node
in
cluster
.
split
(
'-'
):
if
node
not
in
nodemap
:
raise
RuntimeError
(
'%s: node %s: no node info'
%
(
labkey
,
node
))
Bu
=
Bl
[
labkey
].
byunit
()
...
...
@@ -326,61 +332,54 @@ def main():
#fig.text(0.5, 0.04, "XXX number of clients running simultaneously", ha='center')
fig
.
text
(
0.5
,
0.204
,
"XXX number of clients running simultaneously"
,
ha
=
'center'
)
#ax1 = plt.subplot(121)
ax1
=
plt
.
subplot2grid
((
7
,
2
),
(
0
,
0
),
rowspan
=
6
)
ax1
.
set_title
(
u'#requests, object/s (↑ is better)'
)
# XXX add vspace between title and plot
# XXX req/s hardcoded. XXX other units?
Sreq
=
xseriesof
(
Bu
[
Unit
(
'req/s'
)])
if
Sreq
is
not
None
:
# XXX + nproc=...
plotseries
(
ax1
,
labkey
,
Sreq
)
else
:
plt
.
text
(
"xxx not found"
)
if
Sreq
is
None
:
raise
RuntimeError
(
'%s: req/s: series not found'
%
(
labkey
,))
plotseries
(
ax1
,
labkey
,
Sreq
)
#ax2 = plt.subplot(122)
#ax2 = plt.subplot2grid((1,2), (0,1))
ax2
=
plt
.
subplot2grid
((
7
,
2
),
(
0
,
1
),
rowspan
=
6
)
ax2
.
set_title
(
u'latency, µs/object (↓ is better)'
)
Slat
=
xseriesof
(
Bu
[
Unit
(
u'latency-µs/object'
)])
if
Slat
is
not
None
:
# FIXME use same colors/styles for corresponding lines in ax1
plotseries
(
ax2
,
labkey
,
Slat
)
if
Slat
is
None
:
raise
RuntimeError
(
'%s: latency-µs/object: series not found'
%
(
labkey
,))
# don't show legend in latency plot - instead show latency details for client=1
ax2
.
legend
().
set_visible
(
False
)
plotseries
(
ax2
,
labkey
,
Slat
)
ax21
=
zoomed_inset_axes
(
ax2
,
8
,
loc
=
'upper left'
,
borderpad
=
3.0
)
zlatmax
=
200
# XXX hardcoded
zxmin
,
zxmax
=
0.8
,
1.2
# XXX adjust?
ax21
.
set_ylim
(
0
,
zlatmax
)
ax21
.
set_xlim
(
zxmin
,
zxmax
)
ax21
.
set_xticks
([])
ax21
.
set_xticklabels
([])
# don't show legend in latency plot - instead show latency details for client=1
ax2
.
legend
().
set_visible
(
False
)
# vvv a bit adjusted mark_inset(ax2, ax21, ...) - to connect box'es the way we need
rect
=
TransformedBbox
(
ax21
.
viewLim
,
ax2
.
transData
)
ax2
.
add_patch
(
BboxPatch
(
rect
,
fill
=
False
,
fc
=
"none"
,
ec
=
"0.5"
,
lw
=
0.5
))
ax2
.
add_patch
(
BboxConnectorPatch
(
ax21
.
bbox
,
rect
,
3
,
2
,
4
,
1
,
ec
=
"0.5"
,
lw
=
0.5
))
ax21
=
zoomed_inset_axes
(
ax2
,
8
,
loc
=
'upper left'
,
borderpad
=
3.0
)
zlatmax
=
200
# XXX hardcoded
zxmin
,
zxmax
=
0.8
,
1.2
# XXX adjust?
ax21
.
set_ylim
(
0
,
zlatmax
)
ax21
.
set_xlim
(
zxmin
,
zxmax
)
ax21
.
set_xticks
([])
ax21
.
set_xticklabels
([])
plotlat1
(
ax21
,
Slat
)
# vvv a bit adjusted mark_inset(ax2, ax21, ...) - to connect box'es the way we need
rect
=
TransformedBbox
(
ax21
.
viewLim
,
ax2
.
transData
)
ax2
.
add_patch
(
BboxPatch
(
rect
,
fill
=
False
,
fc
=
"none"
,
ec
=
"0.5"
,
lw
=
0.5
))
ax2
.
add_patch
(
BboxConnectorPatch
(
ax21
.
bbox
,
rect
,
3
,
2
,
4
,
1
,
ec
=
"0.5"
,
lw
=
0.5
))
plotlat1
(
ax21
,
Slat
)
else
:
plt
.
text
(
"xxx not found"
)
# legend showing labels from labkey
#
figure-global
legend showing labels from labkey
# https://matplotlib.org/tutorials/intermediate/legend_guide.html#multiple-legends-on-the-same-axes
lh
=
[
r0
]
*
len
(
labkey
)
ltext
=
[
'%s: %s'
%
(
k
,
v
)
for
k
,
v
in
labkey
]
fig
.
legend
(
lh
,
ltext
,
handlelength
=
0
,
handletextpad
=
0
,
loc
=
"upper right"
)
#
fig.tight_layout()
#
reduce margins
fig
.
subplots_adjust
(
left
=
0.05
,
# no big marging on the left
right
=
0.95
,
# ----//---- r
...
...
@@ -393,13 +392,11 @@ def main():
fig
.
text
(
0.003
,
0.995
,
date
,
ha
=
'left'
,
va
=
'top'
,
fontsize
=
8
)
# XXX fs -> 7
# text about nodes
# XXX also verify we have all nodes from `cluster`
assert
len
(
nodemap
)
<=
2
# XXX fragile
nodemap
[
'rio'
]
=
nodemap
[
'deco'
]
# FIXME temp
for
i
,
node
in
enumerate
(
nodemap
):
ax
=
plt
.
subplot2grid
((
7
,
2
),
(
6
,
i
),
rowspan
=
1
)
# XXX 7,6 hardcoded
ax
.
set_axis_off
()
#ax.set_ylabel(node) # does not show when axis are off
ax
.
text
(
-
0.02
,
0.25
,
node
,
rotation
=
'vertical'
,
ha
=
'center'
,
va
=
'center'
)
# XXX font size?
h
=
1.00
-
0.10
...
...
@@ -412,7 +409,6 @@ def main():
#print t.get_position(), t.get_unitless_position()
#print t.get_window_extent(renderer=fig.canvas.get_renderer())
#print t.axes
h
-=
0.08
*
len
(
warn
.
split
(
'
\
n
'
))
# XXX hack
ax
.
text
(
0.01
,
h
-
hmargin
,
labtext
(
nodemap
[
node
],
nowarnings
=
True
),
**
tsty
)
...
...
@@ -426,6 +422,5 @@ def main():
if
__name__
==
'__main__'
:
main
()
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