Commit 0c4e10dd authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 9eae441c
...@@ -286,6 +286,7 @@ def labwarn(labels): ...@@ -286,6 +286,7 @@ def labwarn(labels):
def main(): def main():
B, _, extv = xload_file(sys.argv[1]) B, _, extv = xload_file(sys.argv[1])
# extract neotest extension blocks with nodes
# extv -> node {}, date # extv -> node {}, date
nodemap = OrderedDict() nodemap = OrderedDict()
date = None date = None
...@@ -301,22 +302,27 @@ def main(): ...@@ -301,22 +302,27 @@ def main():
if 'date' in ext: if 'date' in ext:
if date is None: if date is None:
date = ext['date'] date = ext['date']
# XXX also check dates on client/server are close enough to each other?
del ext['date'] del ext['date']
# XXX if date = None -> warning "no date found"
if date is None: if date is None:
date = "date: ?" date = "date: ?"
splitby = ['dataset', 'cluster'] Bl = B.bylabel(['dataset', 'cluster'])
Bl = B.bylabel(splitby)
for labkey in Bl: for labkey in Bl:
# FIXME hack # FIXME hack
if labkey == (): # cpu benchmarks if labkey == (): # cpu benchmarks
continue 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() Bu = Bl[labkey].byunit()
...@@ -326,29 +332,24 @@ def main(): ...@@ -326,29 +332,24 @@ def main():
#fig.text(0.5, 0.04, "XXX number of clients running simultaneously", ha='center') #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') 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 = plt.subplot2grid((7,2), (0,0), rowspan=6)
ax1.set_title(u'#requests, object/s (↑ is better)') # XXX add vspace between title and plot ax1.set_title(u'#requests, object/s (↑ is better)') # XXX add vspace between title and plot
# XXX req/s hardcoded. XXX other units? # XXX req/s hardcoded. XXX other units?
Sreq = xseriesof(Bu[Unit('req/s')]) Sreq = xseriesof(Bu[Unit('req/s')])
if Sreq is not None: if Sreq is None:
# XXX + nproc=... raise RuntimeError('%s: req/s: series not found' % (labkey,))
plotseries(ax1, labkey, Sreq)
else:
plt.text("xxx not found")
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 = plt.subplot2grid((7,2), (0,1), rowspan=6)
ax2.set_title(u'latency, µs/object (↓ is better)') ax2.set_title(u'latency, µs/object (↓ is better)')
Slat = xseriesof(Bu[Unit(u'latency-µs/object')]) Slat = xseriesof(Bu[Unit(u'latency-µs/object')])
if Slat is not None: if Slat is None:
# FIXME use same colors/styles for corresponding lines in ax1 raise RuntimeError('%s: latency-µs/object: series not found' % (labkey,))
plotseries(ax2, labkey, Slat) plotseries(ax2, labkey, Slat)
# don't show legend in latency plot - instead show latency details for client=1 # don't show legend in latency plot - instead show latency details for client=1
...@@ -369,18 +370,16 @@ def main(): ...@@ -369,18 +370,16 @@ def main():
plotlat1(ax21, Slat) 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 # https://matplotlib.org/tutorials/intermediate/legend_guide.html#multiple-legends-on-the-same-axes
lh = [r0] * len(labkey) lh = [r0] * len(labkey)
ltext = ['%s: %s' % (k,v) for k,v in labkey] ltext = ['%s: %s' % (k,v) for k,v in labkey]
fig.legend(lh, ltext, handlelength=0, handletextpad=0, loc="upper right") fig.legend(lh, ltext, handlelength=0, handletextpad=0, loc="upper right")
#fig.tight_layout() # reduce margins
fig.subplots_adjust( fig.subplots_adjust(
left=0.05, # no big marging on the left left=0.05, # no big marging on the left
right=0.95, # ----//---- r right=0.95, # ----//---- r
...@@ -393,13 +392,11 @@ def main(): ...@@ -393,13 +392,11 @@ def main():
fig.text(0.003, 0.995, date, ha='left', va='top', fontsize=8) # XXX fs -> 7 fig.text(0.003, 0.995, date, ha='left', va='top', fontsize=8) # XXX fs -> 7
# text about nodes # text about nodes
# XXX also verify we have all nodes from `cluster`
assert len(nodemap) <= 2 # XXX fragile assert len(nodemap) <= 2 # XXX fragile
nodemap['rio'] = nodemap['deco'] # FIXME temp nodemap['rio'] = nodemap['deco'] # FIXME temp
for i, node in enumerate(nodemap): for i, node in enumerate(nodemap):
ax = plt.subplot2grid((7,2), (6,i), rowspan=1) # XXX 7,6 hardcoded ax = plt.subplot2grid((7,2), (6,i), rowspan=1) # XXX 7,6 hardcoded
ax.set_axis_off() 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? ax.text(-0.02, 0.25, node, rotation='vertical', ha='center', va='center') # XXX font size?
h = 1.00 - 0.10 h = 1.00 - 0.10
...@@ -412,7 +409,6 @@ def main(): ...@@ -412,7 +409,6 @@ def main():
#print t.get_position(), t.get_unitless_position() #print t.get_position(), t.get_unitless_position()
#print t.get_window_extent(renderer=fig.canvas.get_renderer()) #print t.get_window_extent(renderer=fig.canvas.get_renderer())
#print t.axes #print t.axes
h -= 0.08 * len(warn.split('\n')) # XXX hack h -= 0.08 * len(warn.split('\n')) # XXX hack
ax.text(0.01, h-hmargin, labtext(nodemap[node], nowarnings=True), **tsty) ax.text(0.01, h-hmargin, labtext(nodemap[node], nowarnings=True), **tsty)
...@@ -426,6 +422,5 @@ def main(): ...@@ -426,6 +422,5 @@ def main():
if __name__ == '__main__': if __name__ == '__main__':
main() main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment