lisa.analysis.base.TraceAnalysisBase#
- class lisa.analysis.base.TraceAnalysisBase(trace, proxy=None)[source]#
Bases:
AnalysisHelpers
Base class for Analysis modules.
- Parameters:
trace (lisa.trace.Trace) – input Trace object
- Design notes:
Method depending on certain trace events must be decorated with
lisa.trace.requires_events()
Properties
logger
inheritedConvenience short-hand for
self.get_logger()
.name
inheritedName of the analysis class.
Methods
Decorator to enable caching of the output of dataframe getter function in the trace cache.
Call a method of a subclass on a given trace.
Dataframe function decorator.
Returns the set of all events used by any of the methods.
Return the default path to use to save plots for the analysis.
get_logger()
inheritedProvides a
logging.Logger
named aftercls
.get_plot_methods()
inheritedlog_locals()
inheritedDebugging aid: log the local variables of the calling function.
plot_method()
inheritedPlot function decorator.
save_plot()
inheritedSave a holoviews element or
matplotlib.figure.Figure
as an image file.
Properties#
- property TraceAnalysisBase.logger#
Inherited property, see
lisa.utils.Loggable.logger
Convenience short-hand for
self.get_logger()
.
- abstract property TraceAnalysisBase.name#
Inherited property, see
lisa.analysis.base.AnalysisHelpers.name
Name of the analysis class.
Methods#
- classmethod TraceAnalysisBase.cache(f, fmt='parquet', ignored_params=None)[source]#
Called on
Trace
instances astrace.ana.<property object at 0x7fbf15476ed0>.cache()
Decorator to enable caching of the output of dataframe getter function in the trace cache.
This will write the return data to the swap as well, so processing can be skipped completely when possible.
- Parameters:
fmt (str) – Format of the data to write to the cache. This will influence the extension of the cache file created. If
disk-only
format is chosen, the data is not retained in memory and the path to the allocated cache file is passed as first parameter to the wrapped function. This allows manual management of the file’s content, as well having a path to a file to pass to external tools if they can consume the data directly.ignored_params (list(str)) – Parameters to ignore when trying to hit the cache.
- classmethod TraceAnalysisBase.call_on_trace(meth, trace, meth_kwargs)[source]#
Called on
Trace
instances astrace.ana.<property object at 0x7fbf15476ed0>.call_on_trace()
Call a method of a subclass on a given trace.
- Parameters:
meth (collections.abc.Callable) – Function (method) defined on a subclass.
trace (lisa.trace.Trace) – Trace object to use
meth_kwargs (dict) – Dictionary of keyword arguments to pass to
meth
It will create an instance of the right analysis, bind the function to it and call the resulting bound method with
meth_kwargs
extra keyword arguments.
- classmethod TraceAnalysisBase.df_method(f, index=None)[source]#
Called on
Trace
instances astrace.ana.<property object at 0x7fbf15476ed0>.df_method()
Dataframe function decorator.
It provides among other things:
Dataframe format conversion
- classmethod TraceAnalysisBase.get_all_events()[source]#
Called on
Trace
instances astrace.ana.<property object at 0x7fbf15476ed0>.get_all_events()
Returns the set of all events used by any of the methods.
- classmethod TraceAnalysisBase.get_analysis_classes()[source]#
Called on
Trace
instances astrace.ana.<property object at 0x7fbf15476ed0>.get_analysis_classes()
- TraceAnalysisBase.get_default_plot_path(**kwargs)[source]#
Called on
Trace
instances astrace.ana.<property object at 0x7fbf15476ed0>.get_default_plot_path()
Return the default path to use to save plots for the analysis.
- classmethod TraceAnalysisBase.get_df_methods(*args, **kwargs)[source]#
Called on
Trace
instances astrace.ana.<property object at 0x7fbf15476ed0>.get_df_methods()
- classmethod TraceAnalysisBase.get_logger(suffix=None)#
Inherited method, see
lisa.utils.Loggable.get_logger()
Provides a
logging.Logger
named aftercls
.
- classmethod TraceAnalysisBase.get_plot_methods(*args, **kwargs)#
Inherited method, see
lisa.analysis.base.AnalysisHelpers.get_plot_methods()
- classmethod TraceAnalysisBase.log_locals(var_names=None, level='debug')#
Inherited method, see
lisa.utils.Loggable.log_locals()
Debugging aid: log the local variables of the calling function.
- classmethod TraceAnalysisBase.plot_method(f)#
Inherited method, see
lisa.analysis.base.AnalysisHelpers.plot_method()
Plot function decorator.
- TraceAnalysisBase.save_plot(figure, filepath=None, img_format=None, backend=None)#
Inherited method, see
lisa.analysis.base.AnalysisHelpers.save_plot()
Save a holoviews element or
matplotlib.figure.Figure
as an image file.