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,61 +332,54 @@ def main(): ...@@ -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.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)
# don't show legend in latency plot - instead show latency details for client=1 plotseries(ax2, labkey, Slat)
ax2.legend().set_visible(False)
ax21 = zoomed_inset_axes(ax2, 8, loc='upper left', borderpad=3.0) # don't show legend in latency plot - instead show latency details for client=1
zlatmax = 200 # XXX hardcoded ax2.legend().set_visible(False)
zxmin, zxmax = 0.8, 1.2 # XXX adjust?
ax21.set_ylim(0, zlatmax)
ax21.set_xlim(zxmin, zxmax)
ax21.set_xticks([])
ax21.set_xticklabels([])
# vvv a bit adjusted mark_inset(ax2, ax21, ...) - to connect box'es the way we need ax21 = zoomed_inset_axes(ax2, 8, loc='upper left', borderpad=3.0)
rect = TransformedBbox(ax21.viewLim, ax2.transData) zlatmax = 200 # XXX hardcoded
ax2.add_patch(BboxPatch(rect, fill=False, fc="none", ec="0.5", lw=0.5)) zxmin, zxmax = 0.8, 1.2 # XXX adjust?
ax2.add_patch(BboxConnectorPatch(ax21.bbox, rect, 3,2, 4,1, ec="0.5", lw=0.5)) 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 # 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