.. title:: HRTxtTraceParser lisa.trace.HRTxtTraceParser =========================== .. autoclass:: lisa.trace::HRTxtTraceParser :no-members: :no-inherited-members: :no-undoc-members: :no-private-members: :no-special-members: .. rubric:: Attributes .. list-table:: :align: left * - :attr:`~lisa.trace.HRTxtTraceParser.EVENT_DESCS` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.SimpleTxtTraceParser Mapping of event names to parser description as a dict. * - :attr:`~lisa.trace.HRTxtTraceParser.HEADER_REGEX` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.SimpleTxtTraceParser Default regex to use to parse event header. It must parse the following groups:. * - :attr:`~lisa.trace.TxtTraceParserBase.DEFAULT_EVENT_PARSER_CLS` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TxtTraceParserBase Class used to create event parsers when inferred from the trace. * - :attr:`~lisa.trace.TxtTraceParserBase.DTYPE_INFERENCE_ORDER` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TxtTraceParserBase When the dtype of a field is not provided by a user-defined parser, these dtypes will be tried in order to convert the column from string to something more appropriate. * - :attr:`~lisa.trace.TxtTraceParserBase.HEADER_FIELDS` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TxtTraceParserBase Pandas dtype of the header fields. * - :attr:`~lisa.trace.TraceParserBase.METADATA_KEYS` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TraceParserBase Possible metadata keys. .. rubric:: Properties .. list-table:: :align: left * - :attr:`~lisa.utils.Loggable.logger` :sup:`inherited` - .. withrefctx:: :module: lisa.utils :class: lisa.utils.Loggable Convenience short-hand for ``self.get_logger()``. .. rubric:: Methods .. list-table:: :align: left * - :meth:`~lisa.trace.TraceParserBase.__enter__` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TraceParserBase * - :meth:`~lisa.trace.TraceParserBase.__exit__` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TraceParserBase * - :meth:`~lisa.utils.PartialInit.factory` :sup:`inherited` - .. withrefctx:: :module: lisa.utils :class: lisa.utils.PartialInit Decorator to use on alternative constructors, i.e. classmethods that return instances of the class. * - :meth:`~lisa.trace.TxtTraceParserBase.from_string` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TxtTraceParserBase Build an instance from a single multiline string. * - :meth:`~lisa.trace.TxtTraceParserBase.from_txt_file` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TxtTraceParserBase Build an instance from a path to a text file. * - :meth:`~lisa.trace.TraceParserBase.get_all_metadata` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TraceParserBase Collect all available metadata. * - :meth:`~lisa.utils.Loggable.get_logger` :sup:`inherited` - .. withrefctx:: :module: lisa.utils :class: lisa.utils.Loggable Provides a :class:`logging.Logger` named after ``cls``. * - :meth:`~lisa.trace.TxtTraceParserBase.get_metadata` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TxtTraceParserBase Return the metadata value. * - :meth:`~lisa.trace.TraceParserBase.get_parser_id` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TraceParserBase Get the unique ID of that parser. Any parameter affecting the output dataframes or metadata must be somehow part of that ID, so that the cache is not accidentally hit with stale data. * - :meth:`~lisa.utils.Loggable.log_locals` :sup:`inherited` - .. withrefctx:: :module: lisa.utils :class: lisa.utils.Loggable Debugging aid: log the local variables of the calling function. * - :meth:`~lisa.trace.TraceParserBase.parse_all_events` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TraceParserBase Parse all available events. * - :meth:`~lisa.trace.TxtTraceParserBase.parse_event` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TxtTraceParserBase Parse the given event from the trace and return a :class:`pandas.DataFrame` with the following columns:. * - :meth:`~lisa.trace.TraceParserBase.parse_events` :sup:`inherited` - .. withrefctx:: :module: lisa.trace :class: lisa.trace.TraceParserBase Same as :meth:`parse_event` but taking a list of events as input, and returning a mapping of event names to :class:`pandas.DataFrame` for each. Attributes ---------- .. autoattribute:: lisa.trace::HRTxtTraceParser.EVENT_DESCS .. autoattribute:: lisa.trace::HRTxtTraceParser.HEADER_REGEX .. autoattribute:: lisa.trace::HRTxtTraceParser.DEFAULT_EVENT_PARSER_CLS .. autoattribute:: lisa.trace::HRTxtTraceParser.DTYPE_INFERENCE_ORDER .. autoattribute:: lisa.trace::HRTxtTraceParser.HEADER_FIELDS .. autoattribute:: lisa.trace::HRTxtTraceParser.METADATA_KEYS Properties ---------- .. autoproperty:: lisa.trace::HRTxtTraceParser.logger Methods ------- .. automethod:: lisa.trace::HRTxtTraceParser.__enter__ .. automethod:: lisa.trace::HRTxtTraceParser.__exit__ .. automethod:: lisa.trace::HRTxtTraceParser.factory .. automethod:: lisa.trace::HRTxtTraceParser.from_string .. automethod:: lisa.trace::HRTxtTraceParser.from_txt_file .. automethod:: lisa.trace::HRTxtTraceParser.get_all_metadata .. automethod:: lisa.trace::HRTxtTraceParser.get_logger .. automethod:: lisa.trace::HRTxtTraceParser.get_metadata .. automethod:: lisa.trace::HRTxtTraceParser.get_parser_id .. automethod:: lisa.trace::HRTxtTraceParser.log_locals .. automethod:: lisa.trace::HRTxtTraceParser.parse_all_events .. automethod:: lisa.trace::HRTxtTraceParser.parse_event .. automethod:: lisa.trace::HRTxtTraceParser.parse_events