- y_val = test_data.get("LOWER", None)
- if y_val:
- y_val /= 1000000
- if y_val > y_max:
- y_max = y_val
-
- time = "No Information"
- result = "No Information"
- hovertext = ("{name}<br>"
- "Packet Throughput: {val:.2f}Mpps<br>"
- "Final Duration: {time}<br>"
- "Result: {result}".format(name=name,
- val=y_val,
- time=time,
- result=result))
- traces.append(plgo.Bar(x=[str(idx) + '.', ],
- y=[y_val, ],
- name=name,
- text=hovertext,
- hoverinfo="text"))
- try:
- # Create plot
- layout = deepcopy(plot["layout"])
- if layout.get("title", None):
- layout["title"] = "<b>Packet Throughput:</b> {0}". \
- format(layout["title"])
- if y_max:
- layout["yaxis"]["range"] = [0, y_max + 1]
- plpl = plgo.Figure(data=traces, layout=layout)
- # Export Plot
- logging.info(" Writing file '{0}{1}'.".
- format(plot["output-file"], plot["output-file-type"]))
- ploff.plot(plpl, show_link=False, auto_open=False,
- filename='{0}{1}'.format(plot["output-file"],
- plot["output-file-type"]))
- except PlotlyError as err:
- logging.error(" Finished with error: {}".
- format(repr(err).replace("\n", " ")))
- return
-
-
-def plot_soak_boxes(plot, input_data):
- """Generate the plot(s) with algorithm: plot_soak_boxes
- 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
- plot_title = plot.get("title", "")
- logging.info(" Creating the data set for the {0} '{1}'.".
- format(plot.get("type", ""), plot_title))
- data = input_data.filter_data(plot)
- if data is None:
- logging.error("No data.")
- return