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 a pandas.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

traces

lisa.utils.LazyMapping that maps job names & iteration numbers to their corresponding lisa.trace.Trace.

df inherited

pandas.DataFrame containing the data collected.

logger inherited

Convenience short-hand for self.get_logger().

stats inherited

Short-hand property equivalent to self.get_stats().

Methods

get_logger() inherited

Provides a logging.Logger named after cls.

get_stats() inherited

Returns a lisa.stats.Stats loaded with the result pandas.DataFrame.

log_locals() inherited

Debugging 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 corresponding lisa.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 after cls.

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 result pandas.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.