This chapter explains how to visualize trace data as you expect. Gallery section shows which type of visualization is supported by CARET. CARET serves uniform visualization API to create such graphs.
Uniform API design#
Plot class to visualize trace data. The following sample code shows the basic usage of
from caret_analyze import Application, Architecture, Lttng from caret_analyze.plot import Plot from bokeh.plotting import output_notebook, figure, show output_notebook() # Load recorded data lttng = Lttng('/path/to/trace_data') # Load an Architecture object arch = Architecture('yaml', '/path/to/architecture_file') # Map the architecture object to the recorded data app = Application(arch, lttng) # Focus on a target callback callback = app.get_callback('/target/callback/name') # Get plot object for visualizing callback frequency # Plot.create_[Metrics]_[GraphType]_plot(data) # is format to get a target data set to visualize plot = Plot.create_frequency_timeseries_plot(callback) # Assign a table to callback_df object callback_df = plot.to_dataframe() # Create a graph for frequency of callback execution plot.show()
plot object is obtained from
Plot.create_[Metrics]_[GraphType]_plot(data). The argument of
data is, for example, a
CallbackBase-based object or a
Communication-based object. A list of
Communication is also acceptable as explained later.
Any of performance metrics such as
period is given as
GraphType is served to select a graph type such as time-series or histogram.
plot object has following four method;
to_dataframe()method returns a table including time-series data on a given metrics. If you want to create another type of graph manually, you will get the table by
to_dataframe()method and convert it into the expected graph.
show()method creates a figure of time-series graph. In other words,
show()method visualizes the time-series data.
save()method saves the figure in an arbitrary path.
figure()method returns the corresponding figure handler. This method allows additional customization of the figure before it is displayed.
This section lists methods to visualize several metrics. You will find a sample figure corresponding to metrics if you access the link. Some of methods are not designed according to uniform API design, and they are exception.
- Visualize callback scheduling
Here, CARET takes into account communication when both transmission and reception on a message are performed successfully without being lost. See Premise of communication for more details. Feel free to skip this page if you are not interested in.
- Visualize message flow of a target path
CARET provides some APIs which can help users to focus on their respective interest.
CARET analyze API document describes the parameters and returns of APIs.