Rename *Processor classes to *Handler

This commit is contained in:
Christophe Bedard 2019-08-02 10:35:39 +02:00
parent b1d2b16b6d
commit e1446f36aa
4 changed files with 15 additions and 12 deletions

View file

@ -19,8 +19,9 @@ import argparse
import time import time
from tracetools_analysis.loading import load_pickle from tracetools_analysis.loading import load_pickle
from tracetools_analysis.processor.cpu_time import CpuTimeProcessor from tracetools_analysis.processor.cpu_time import CpuTimeHandler
from tracetools_analysis.processor.ros2 import Ros2Processor from tracetools_analysis.processor.profile import ProfileHandler
from tracetools_analysis.processor.ros2 import Ros2Handler
def parse_args(): def parse_args():
@ -37,11 +38,13 @@ def main():
start_time = time.time() start_time = time.time()
events = load_pickle(pickle_filename) events = load_pickle(pickle_filename)
processor = Ros2Processor.process(events) # ros2_handler = Ros2Handler.process(events)
cpu_processor = CpuTimeProcessor.process(events) # cpu_handler = CpuTimeHandler.process(events)
profile_handler = ProfileHandler.process(events)
time_diff = time.time() - start_time time_diff = time.time() - start_time
print(f'processed {len(events)} events in {time_diff * 1000:.2f} ms') print(f'processed {len(events)} events in {time_diff * 1000:.2f} ms')
processor.get_data_model().print_model() # ros2_handler.get_data_model().print_model()
cpu_processor.get_data_model().print_model() # cpu_handler.get_data_model().print_model()
profile_handler.get_data_model().print_model()

View file

@ -23,9 +23,9 @@ from . import EventMetadata
from ..data_model.cpu_time import CpuTimeDataModel from ..data_model.cpu_time import CpuTimeDataModel
class CpuTimeProcessor(EventHandler): class CpuTimeHandler(EventHandler):
""" """
Processor that extracts data for CPU time. Handler that extracts data for CPU time.
It extracts timestamps from sched_switch events to later compute CPU time per thread. It extracts timestamps from sched_switch events to later compute CPU time per thread.
""" """

View file

@ -28,9 +28,9 @@ from . import EventMetadata
from ..data_model.profile import ProfileDataModel from ..data_model.profile import ProfileDataModel
class ProfileProcessor(EventHandler): class ProfileHandler(EventHandler):
""" """
Processor that extracts profiling information. Handler that extracts profiling information.
It uses the following events: It uses the following events:
* lttng_ust_cyg_profile_fast:func_entry * lttng_ust_cyg_profile_fast:func_entry

View file

@ -23,9 +23,9 @@ from . import EventMetadata
from ..data_model.ros import RosDataModel from ..data_model.ros import RosDataModel
class Ros2Processor(EventHandler): class Ros2Handler(EventHandler):
""" """
ROS 2-aware event processing/handling class implementation. ROS 2-aware event handling class implementation.
Handles a trace's events and builds a model with the data. Handles a trace's events and builds a model with the data.
""" """