X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Freport_gen%2Frun_plot.py;h=476813883fc2ef0dc84de8623691ba002905a68f;hp=4218ecb93a20a3132c3f14af8638e37755632836;hb=5b702673375a2a098311c23ab83487d3e1e02e72;hpb=7e77c9160cc3eb6f7f585df70231c4eeb07421d4 diff --git a/resources/tools/report_gen/run_plot.py b/resources/tools/report_gen/run_plot.py index 4218ecb93a..476813883f 100644 --- a/resources/tools/report_gen/run_plot.py +++ b/resources/tools/report_gen/run_plot.py @@ -143,6 +143,10 @@ def parse_args(): parser.add_argument("-d", "--latency", choices=['lat_10', 'lat_50', 'lat_100'], help="Latency to draw") + parser.add_argument("-p", "--plot", + choices=['box', 'scatter'], + default='box', + help="Throughput plot type") parser.add_argument("-i", "--input", help="Input folder") parser.add_argument("-o", "--output", required=True, @@ -160,13 +164,9 @@ def main(): xdata, ydata = parse_data_pps(args) # Print data into console for debug - row_format = "{:>60}" * (len(xdata) + 1) - print row_format.format(args.title, *xdata) + print args.title for data in ydata: - try: - print row_format.format(data, *ydata[data][1::2]) - except IndexError: - print "{:>60}".format(data), ydata[data] + print data + ";" + ";".join(str(val) for val in ydata[data][1::2]) if xdata and ydata: traces = [] @@ -193,12 +193,23 @@ def main(): boxmean=False, )) else: - traces.append(plgo.Scatter( - x=ydata[suite][0::2], - y=ydata[suite][1::2], - mode='lines+markers', - name=str(i+1)+'. '+suite.lower().replace('-ndrdisc',''), - )) + if args.plot == 'box': + traces.append(plgo.Box( + x=[str(i+1)+'. TC'] * len(ydata[suite][1::2]), + y=ydata[suite][1::2], + name=str(i+1)+'. '+suite.lower().replace('-ndrdisc',''), + hoverinfo='x+y', + boxpoints='outliers', + )) + elif args.plot == 'scatter': + traces.append(plgo.Scatter( + x=ydata[suite][0::2], + y=ydata[suite][1::2], + mode='lines+markers', + name=str(i+1)+'. '+suite.lower().replace('-ndrdisc',''), + )) + else: + pass # Add plot layout layout = plgo.Layout( @@ -215,6 +226,8 @@ def main(): showticklabels=True, tickcolor='rgb(238, 238, 238)', tickmode='linear', + title='Indexed Test Cases' if args.plot == 'box'\ + else '', zeroline=False, ), yaxis=dict( @@ -222,7 +235,8 @@ def main(): hoverformat='' if args.latency else '.4s', linecolor='rgb(238, 238, 238)', linewidth=1, - range=[args.lower, args.upper], + range=[args.lower, args.upper] if args.lower and args.upper\ + else [], showgrid=True, showline=True, showticklabels=True, @@ -243,6 +257,8 @@ def main(): showlegend=True, legend=dict( orientation='h', + y=-1, + yanchor='bottom', ), width=700, height=700,