lisa.wa.WATraceCollector#
- class lisa.wa.WATraceCollector(wa_output, trace_to_df=<function _stub_trace_to_df>, **kwargs)[source]#
Bases:
WAArtifactCollectorBase
WA collector for the trace augmentation.
- Parameters:
trace_to_df (collections.abc.Callable) – Function used by the collector to convert the
lisa.trace.Trace
to apandas.DataFrame
.- Variable keyword arguments:
Forwarded to
lisa.trace.Trace
.
Example:
def trace_idle_analysis(trace): cpu = 0 df = trace.ana.idle.df_cluster_idle_state_residency([cpu]) df = df.reset_index() df['cpu'] = cpu # Melt the column 'time' into lines, so that the dataframe is in # "database" format: each value is uniquely identified by "tag" # columns return df.melt( var_name='metric', value_vars=['time'], id_vars=['idle_state'], ) WAOutput('wa/output/path').get_collector( 'trace', trace_to_df=trace_idle_analysis, ).df
Attributes
Properties
lisa.utils.LazyMapping
that maps job names & iteration numbers to their correspondinglisa.trace.Trace
.df
inheritedpandas.DataFrame
containing the data collected.logger
inheritedConvenience short-hand for
self.get_logger()
.stats
inheritedShort-hand property equivalent to
self.get_stats()
.Methods
get_logger()
inheritedProvides a
logging.Logger
named aftercls
.get_stats()
inheritedReturns a
lisa.stats.Stats
loaded with the resultpandas.DataFrame
.log_locals()
inheritedDebugging aid: log the local variables of the calling function.
Attributes#
- WATraceCollector.NAME = 'trace'#
Properties#
- property WATraceCollector.traces[source]#
lisa.utils.LazyMapping
that maps job names & iteration numbers to their correspondinglisa.trace.Trace
.
- property WATraceCollector.df#
Inherited property, see
lisa.wa.WACollectorBase.df
pandas.DataFrame
containing the data collected.
- property WATraceCollector.logger#
Inherited property, see
lisa.utils.Loggable.logger
Convenience short-hand for
self.get_logger()
.
- property WATraceCollector.stats#
Inherited property, see
lisa.wa.StatsProp.stats
Short-hand property equivalent to
self.get_stats()
.
Methods#
- classmethod WATraceCollector.get_logger(suffix=None)#
Inherited method, see
lisa.utils.Loggable.get_logger()
Provides a
logging.Logger
named aftercls
.
- WATraceCollector.get_stats(ensure_default_groups=True, ref_group=None, agg_cols=None, **kwargs)#
Inherited method, see
lisa.wa.StatsProp.get_stats()
Returns a
lisa.stats.Stats
loaded with the resultpandas.DataFrame
.
- classmethod WATraceCollector.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.