diff options
author | 2020-01-27 15:24:08 +0100 | |
---|---|---|
committer | 2020-01-28 09:40:45 +0000 | |
commit | a89e6e3a7fb413394f83c7ff248aa234a265837c (patch) | |
tree | 7b70e9e8a60b0dd6793ccc6f519926465d38943d /resources | |
parent | 01b75c9d9d6d715faef4ee3136324c77dd05c2ad (diff) |
PAL: Add latency by percentile graph
Change-Id: I38c03e089fd709afc848ecec55474d5c6925a58e
Signed-off-by: Tibor Frank <tifrank@cisco.com>
(cherry picked from commit 6716e51e3a27cfd2850a399c9ccc2818c2038eaf)
Diffstat (limited to 'resources')
-rw-r--r-- | resources/tools/presentation/generator_plots.py | 152 | ||||
-rw-r--r-- | resources/tools/presentation/input_data_parser.py | 4 | ||||
-rw-r--r-- | resources/tools/presentation/specification.yaml | 91 |
3 files changed, 243 insertions, 4 deletions
diff --git a/resources/tools/presentation/generator_plots.py b/resources/tools/presentation/generator_plots.py index ba10ea6da6..da015ddf10 100644 --- a/resources/tools/presentation/generator_plots.py +++ b/resources/tools/presentation/generator_plots.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Cisco and/or its affiliates. +# Copyright (c) 2020 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -60,7 +60,8 @@ def generate_plots(spec, data): u"plot_http_server_perf_box": plot_http_server_perf_box, u"plot_nf_heatmap": plot_nf_heatmap, u"plot_lat_hdrh_bar_name": plot_lat_hdrh_bar_name, - u"plot_lat_hdrh_percentile": plot_lat_hdrh_percentile + u"plot_lat_hdrh_percentile": plot_lat_hdrh_percentile, + u"plot_hdrh_lat_by_percentile": plot_hdrh_lat_by_percentile } logging.info(u"Generating the plots ...") @@ -183,6 +184,153 @@ def plot_lat_hdrh_percentile(plot, input_data): logging.error(f" Finished with error: {repr(err)}") +def plot_hdrh_lat_by_percentile(plot, input_data): + """Generate the plot(s) with algorithm: plot_hdrh_lat_by_percentile + specified in the specification file. + + :param plot: Plot to generate. + :param input_data: Data to process. + :type plot: pandas.Series + :type input_data: InputData + """ + + # Transform the data + logging.info( + f" Creating the data set for the {plot.get(u'type', u'')} " + f"{plot.get(u'title', u'')}." + ) + data = input_data.filter_tests_by_name( + plot, params=[u"latency", u"throughput", u"parent", u"tags", u"type"]) + if data is None or len(data[0][0]) == 0: + logging.error(u"No data.") + return + + graphs = [ + u"LAT0", + u"PDR10", + u"PDR50", + u"PDR90", + u"NDR", + u"PDR" + ] + + for test in data[0][0]: + try: + if test[u"type"] not in (u"NDRPDR",): + logging.warning(f"Invalid test type: {test[u'type']}") + continue + name = re.sub(REGEX_NIC, u"", test[u"parent"]. + replace(u'-ndrpdr', u'').replace(u'2n1l-', u'')) + + logging.info(f" Generating the graph: {name}") + + pdr = test[u"throughput"][u"PDR"][u"LOWER"] + ndr = test[u"throughput"][u"NDR"][u"LOWER"] + + desc = { + u"LAT0": u"No load", + u"PDR10": f"10% PDR background traffic ({(pdr*1e-7):.2f}Mpps)", + u"PDR50": f"50% PDR background traffic ({(pdr*5e-7):.2f}Mpps)", + u"PDR90": f"90% PDR background traffic ({(pdr*9e-7):.2f}Mpps)", + u"PDR": f"100% PDR background traffic ({(pdr*1e-6):.2f}Mpps)", + u"NDR10": f"10% NDR background traffic ({(ndr*1e-7):.2f}Mpps)", + u"NDR50": f"50% NDR background traffic ({(ndr*5e-7):.2f}Mpps)", + u"NDR90": f"90% NDR background traffic ({(ndr*9e-7):.2f}Mpps)", + u"NDR": f"100% NDR background traffic ({(ndr*1e-6):.2f}Mpps)" + } + + fig = make_subplots( + rows=1, + cols=2, + column_widths=[0.5, 0.5], + shared_xaxes=True, + subplot_titles=( + u"<b>Direction: W-E</b>", + u"<b>Direction: E-W</b>" + ), + specs=[[{"type": "scatter"}, {"type": "scatter"}], ] + ) + layout = deepcopy(plot[u"layout"]) + + for color, graph in enumerate(graphs): + for idx, direction in enumerate((u"direction1", u"direction2")): + xaxis = list() + yaxis = list() + hovertext = list() + decoded = hdrh.histogram.HdrHistogram.decode( + test[u"latency"][graph][direction][u"hdrh"] + ) + for item in decoded.get_recorded_iterator(): + percentile = item.percentile_level_iterated_to + xaxis.append((100.0 / (100.0 - percentile)) + if percentile != 100.0 else 1e6) + yaxis.append(item.value_iterated_to) + hovertext.append( + f"<b>{desc[graph]}</b><br>" + f"Percentile: {percentile:.5f}%<br>" + f"Latency: {item.value_iterated_to}uSec" + ) + fig.add_trace( + plgo.Scatter( + x=xaxis, + y=yaxis, + name=desc[graph], + mode=u"lines", + legendgroup=desc[graph], + showlegend=bool(idx), + line=dict( + color=COLORS[color] + ), + hovertext=hovertext, + hoverinfo=u"text" + ), + row=1, + col=idx + 1, + ) + fig.update_xaxes( + row=1, + col=idx + 1, + **layout[u"xaxis"] + ) + fig.update_yaxes( + row=1, + col=idx + 1, + **layout[u"yaxis"] + ) + try: + del layout[u"xaxis"] + except KeyError: + pass + try: + del layout[u"yaxis"] + except KeyError: + pass + + layout[u"title"][u"text"] = f"<b>Latency:</b> {name}" + fig.update_layout(layout) + + # Create plot + file_name = (f"{plot[u'output-file']}-" + f"{name}" + f"{plot.get(u'output-file-type', u'.html')}") + logging.info(f" Writing file {file_name}") + + try: + # Export Plot + ploff.plot(fig, show_link=False, auto_open=False, + filename=file_name) + except PlotlyError as err: + logging.error(f" Finished with error: {repr(err)}") + + except hdrh.codec.HdrLengthException as err: + logging.warning(repr(err)) + continue + + except (ValueError, KeyError) as err: + logging.warning(repr(err)) + continue + + def plot_lat_hdrh_bar_name(plot, input_data): """Generate the plot(s) with algorithm: plot_lat_hdrh_bar_name specified in the specification file. diff --git a/resources/tools/presentation/input_data_parser.py b/resources/tools/presentation/input_data_parser.py index eeabaa8557..574f4950de 100644 --- a/resources/tools/presentation/input_data_parser.py +++ b/resources/tools/presentation/input_data_parser.py @@ -654,9 +654,9 @@ class ExecutionChecker(ResultVisitor): }, } - groups = re.search(self.REGEX_NDRPDR_LAT, msg) + groups = re.search(self.REGEX_NDRPDR_LAT_LONG, msg) if groups is None: - groups = re.search(self.REGEX_NDRPDR_LAT_LONG, msg) + groups = re.search(self.REGEX_NDRPDR_LAT, msg) if groups is None: return latency, u"FAIL" diff --git a/resources/tools/presentation/specification.yaml b/resources/tools/presentation/specification.yaml index 910d1e9a4d..ad6c3ed289 100644 --- a/resources/tools/presentation/specification.yaml +++ b/resources/tools/presentation/specification.yaml @@ -1605,6 +1605,63 @@ paper_bgcolor: "white" plot_bgcolor: "white" + plot-hdrh-latency-by-percentile: + title: + text: "<b>Latency by Percentile Distribution</b>" + xanchor: "center" + x: 0.5 + font: + size: 18 + showlegend: True + legend: + traceorder: "normal" + orientation: "h" + font: + size: 16 + xanchor: "left" + yanchor: "top" + x: 0 + y: -0.2 + bgcolor: "rgba(255, 255, 255, 0)" + bordercolor: "rgba(255, 255, 255, 0)" + xaxis: + type: "log" + title: "<b>Percentile [%]</b>" + titlefont: + size: 14 + autorange: False + fixedrange: False + range: [1e-6, 3] + gridcolor: "rgb(230, 230, 230)" + linecolor: "rgb(220, 220, 220)" + linewidth: 1 + showgrid: True + showline: True + showticklabels: True + tickcolor: "rgb(220, 220, 220)" + tickvals: [1, 2, 1e1, 20, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8] + tickangle: 315 + ticktext: [0, 50, 90, 95, 99, 99.9, 99.99, 99.999, 99.9999, 99.99999, 99.999999] + tickfont: + size: 14 + yaxis: + title: "<b>Packet Latency [uSec]</b>" + titlefont: + size: 14 + gridcolor: "rgb(230, 230, 230)" + linecolor: "rgb(220, 220, 220)" + linewidth: 1 + showgrid: True + showline: True + showticklabels: True + tickcolor: "rgb(220, 220, 220)" + tickfont: + size: 14 + width: 700 + height: 700 + paper_bgcolor: "white" + plot_bgcolor: "white" + - type: "static" src-path: "{DIR[RST]}" dst-path: "{DIR[WORKING,SRC]}" @@ -22611,3 +22668,37 @@ - "tests.dpdk.perf.2n1l-10ge2p1x710-ethip4-ip4base-l3fwd-ndrpdr.64b-8t4c-ethip4-ip4base-l3fwd-ndrpdr" layout: layout: "plot-hdrh-latency-percentile" + +- type: "plot" + title: "Latency by percentile: 2n-skx-xxv710" + algorithm: "plot_hdrh_lat_by_percentile" + output-file: "{DIR[STATIC,VPP]}/2n-skx-xxv710-hdrh-lat-percentile" + data: "plot-vpp-hdrh-lat-2n-skx" + include: + - "Tests.Vpp.Perf.Ip4.2N1L-25Ge2P1Xxv710-Dot1Q-Ip4Base-Ndrpdr.64B-2t1c-dot1q-ip4base-ndrpdr" + - "Tests.Vpp.Perf.Ip4.2N1L-25Ge2P1Xxv710-Ethip4-Ip4Base-Ndrpdr.64B-2t1c-ethip4-ip4base-ndrpdr" + - "Tests.Vpp.Perf.Ip4.2N1L-25Ge2P1Xxv710-Ethip4-Ip4Scale20K-Ndrpdr.64B-2t1c-ethip4-ip4scale20k-ndrpdr" + - "Tests.Vpp.Perf.Ip4.2N1L-25Ge2P1Xxv710-Ethip4-Ip4Scale200K-Ndrpdr.64B-2t1c-ethip4-ip4scale200k-ndrpdr" + - "Tests.Vpp.Perf.Ip4.2N1L-25Ge2P1Xxv710-Ethip4-Ip4Scale2M-Ndrpdr.64B-2t1c-ethip4-ip4scale2m-ndrpdr" + - "Tests.Vpp.Perf.Container Memif.2N1L-25Ge2P1Xxv710-Eth-L2Xcbase-Eth-2Memif-1Dcr-Ndrpdr.64B-2t1c-eth-l2xcbase-eth-2memif-1dcr-ndrpdr" + - "Tests.Vpp.Perf.Container Memif.2N1L-25Ge2P1Xxv710-Dot1Q-L2Bdbasemaclrn-Eth-2Memif-1Dcr-Ndrpdr.64B-2t1c-dot1q-l2bdbasemaclrn-eth-2memif-1dcr-ndrpdr" + - "Tests.Vpp.Perf.Container Memif.2N1L-25Ge2P1Xxv710-Eth-L2Bdbasemaclrn-Eth-2Memif-1Dcr-Ndrpdr.64B-2t1c-eth-l2bdbasemaclrn-eth-2memif-1dcr-ndrpdr" + - "Tests.Vpp.Perf.Container Memif.2N1L-25Ge2P1Xxv710-Ethip4-Ip4Base-Eth-2Memif-1Dcr-Ndrpdr.64B-2t1c-ethip4-ip4base-eth-2memif-1dcr-ndrpdr" + - "Tests.Vpp.Perf.L2.2N1L-10Ge2P1X710-Avf-Eth-L2Xcbase-Ndrpdr.64B-2t1c-avf-eth-l2xcbase-ndrpdr" + - "Tests.Vpp.Perf.L2.2N1L-10Ge2P1X710-Avf-Dot1Q-L2Bdbasemaclrn-Ndrpdr.64B-2t1c-avf-dot1q-l2bdbasemaclrn-ndrpdr" + - "Tests.Vpp.Perf.L2.2N1L-10Ge2P1X710-Avf-Eth-L2Bdbasemaclrn-Ndrpdr.64B-2t1c-avf-eth-l2bdbasemaclrn-ndrpdr" + - "Tests.Vpp.Perf.L2.2N1L-10Ge2P1X710-Dot1Q-L2Bdbasemaclrn-Ndrpdr.64B-2t1c-dot1q-l2bdbasemaclrn-ndrpdr" + - "Tests.Vpp.Perf.L2.2N1L-10Ge2P1X710-Eth-L2Bdbasemaclrn-Ndrpdr.64B-2t1c-eth-l2bdbasemaclrn-ndrpdr" + - "Tests.Vpp.Perf.L2.2N1L-10Ge2P1X710-Eth-L2Bdscale1Mmaclrn-Ndrpdr.64B-2t1c-eth-l2bdscale1mmaclrn-ndrpdr" + - "Tests.Vpp.Perf.L2.25Ge2P1Xxv710-Eth-L2Bdbasemaclrn-Ndrpdr.64B-2t1c-eth-l2bdbasemaclrn-ndrpdr" + - "Tests.Vpp.Perf.Vm Vhost.2N1L-25Ge2P1Xxv710-Eth-L2Xcbase-Eth-2Vhostvr1024-1Vm-Ndrpdr.64B-2t1c-eth-l2xcbase-eth-2vhostvr1024-1vm-ndrpdr" + - "Tests.Vpp.Perf.Vm Vhost.2N1L-25Ge2P1Xxv710-Dot1Q-L2Bdbasemaclrn-Eth-2Vhostvr1024-1Vm-Ndrpdr.64B-2t1c-dot1q-l2bdbasemaclrn-eth-2vhostvr1024-1vm-ndrpdr" + - "Tests.Vpp.Perf.Vm Vhost.2N1L-25Ge2P1Xxv710-Eth-L2Bdbasemaclrn-Eth-2Vhostvr1024-1Vm-Ndrpdr.64B-2t1c-eth-l2bdbasemaclrn-eth-2vhostvr1024-1vm-ndrpdr" + - "Tests.Vpp.Perf.Vm Vhost.2N1L-25Ge2P1Xxv710-Ethip4-Ip4Base-Eth-2Vhostvr1024-1Vm-Ndrpdr.64B-2t1c-ethip4-ip4base-eth-2vhostvr1024-1vm-ndrpdr" + - "Tests.Vpp.Perf.Ip6.2N1L-25Ge2P1Xxv710-Dot1Q-Ip6Base-Ndrpdr.78B-2t1c-dot1q-ip6base-ndrpdr" + - "Tests.Vpp.Perf.Ip6.2N1L-25Ge2P1Xxv710-Ethip6-Ip6Base-Ndrpdr.78B-2t1c-ethip6-ip6base-ndrpdr" + - "Tests.Vpp.Perf.Ip6.2N1L-25Ge2P1Xxv710-Ethip6-Ip6Scale20K-Ndrpdr.78B-2t1c-ethip6-ip6scale20k-ndrpdr" + - "Tests.Vpp.Perf.Ip6.2N1L-25Ge2P1Xxv710-Ethip6-Ip6Scale200K-Ndrpdr.78B-2t1c-ethip6-ip6scale200k-ndrpdr" + - "Tests.Vpp.Perf.Ip6.2N1L-25Ge2P1Xxv710-Ethip6-Ip6Scale2M-Ndrpdr.78B-2t1c-ethip6-ip6scale2m-ndrpdr" + layout: + layout: "plot-hdrh-latency-by-percentile" |