Commit 1b7c909f authored by Christophe Bedard's avatar Christophe Bedard

Fix lint errors

parent edfceca7
Pipeline #68066463 passed with stage
in 1 minute and 28 seconds
......@@ -86,34 +86,54 @@ class DataModel():
'duration',
'intra_process'])
def add_context(self, context_handle, timestamp, pid, version) -> None:
def add_context(
self, context_handle, timestamp, pid, version
) -> None:
self.contexts.loc[context_handle] = [timestamp, pid, version]
def add_node(self, node_handle, timestamp, tid, rmw_handle, name, namespace) -> None:
def add_node(
self, node_handle, timestamp, tid, rmw_handle, name, namespace
) -> None:
self.nodes.loc[node_handle] = [timestamp, tid, rmw_handle, name, namespace]
def add_publisher(self, handle, timestamp, node_handle, rmw_handle, topic_name, depth) -> None:
def add_publisher(
self, handle, timestamp, node_handle, rmw_handle, topic_name, depth
) -> None:
self.publishers.loc[handle] = [timestamp, node_handle, rmw_handle, topic_name, depth]
def add_subscription(self, handle, timestamp, node_handle, rmw_handle, topic_name, depth) -> None:
def add_subscription(
self, handle, timestamp, node_handle, rmw_handle, topic_name, depth
) -> None:
self.subscriptions.loc[handle] = [timestamp, node_handle, rmw_handle, topic_name, depth]
def add_service(self, handle, timestamp, node_handle, rmw_handle, service_name) -> None:
def add_service(
self, handle, timestamp, node_handle, rmw_handle, service_name
) -> None:
self.services.loc[handle] = [timestamp, node_handle, rmw_handle, service_name]
def add_client(self, handle, timestamp, node_handle, rmw_handle, service_name) -> None:
def add_client(
self, handle, timestamp, node_handle, rmw_handle, service_name
) -> None:
self.clients.loc[handle] = [timestamp, node_handle, rmw_handle, service_name]
def add_timer(self, handle, timestamp, period) -> None:
def add_timer(
self, handle, timestamp, period
) -> None:
self.timers.loc[handle] = [timestamp, period]
def add_callback_object(self, handle, timestamp, callback_object) -> None:
def add_callback_object(
self, handle, timestamp, callback_object
) -> None:
self.callback_objects.loc[handle] = [timestamp, callback_object]
def add_callback_symbol(self, callback_object, timestamp, symbol) -> None:
def add_callback_symbol(
self, callback_object, timestamp, symbol
) -> None:
self.callback_symbols.loc[callback_object] = [timestamp, symbol]
def add_callback_instance(self, callback_object, timestamp, duration, intra_process) -> None:
def add_callback_instance(
self, callback_object, timestamp, duration, intra_process
) -> None:
data = {
'callback_object': callback_object,
'timestamp': timestamp,
......
......@@ -71,14 +71,18 @@ class Ros2Processor(EventHandler):
def get_data_model(self) -> DataModel:
return self._data
def _handle_rcl_init(self, event: Dict, metadata: EventMetadata) -> None:
def _handle_rcl_init(
self, event: Dict, metadata: EventMetadata
) -> None:
context_handle = get_field(event, 'context_handle')
timestamp = metadata.timestamp
pid = metadata.pid
version = get_field(event, 'version')
self._data.add_context(context_handle, timestamp, pid, version)
def _handle_rcl_node_init(self, event: Dict, metadata: EventMetadata) -> None:
def _handle_rcl_node_init(
self, event: Dict, metadata: EventMetadata
) -> None:
handle = get_field(event, 'node_handle')
timestamp = metadata.timestamp
tid = metadata.tid
......@@ -87,7 +91,9 @@ class Ros2Processor(EventHandler):
namespace = get_field(event, 'namespace')
self._data.add_node(handle, timestamp, tid, rmw_handle, name, namespace)
def _handle_rcl_publisher_init(self, event: Dict, metadata: EventMetadata) -> None:
def _handle_rcl_publisher_init(
self, event: Dict, metadata: EventMetadata
) -> None:
handle = get_field(event, 'publisher_handle')
timestamp = metadata.timestamp
node_handle = get_field(event, 'node_handle')
......@@ -96,7 +102,9 @@ class Ros2Processor(EventHandler):
depth = get_field(event, 'queue_depth')
self._data.add_publisher(handle, timestamp, node_handle, rmw_handle, topic_name, depth)
def _handle_subscription_init(self, event: Dict, metadata: EventMetadata) -> None:
def _handle_subscription_init(
self, event: Dict, metadata: EventMetadata
) -> None:
handle = get_field(event, 'subscription_handle')
timestamp = metadata.timestamp
node_handle = get_field(event, 'node_handle')
......@@ -105,13 +113,17 @@ class Ros2Processor(EventHandler):
depth = get_field(event, 'queue_depth')
self._data.add_subscription(handle, timestamp, node_handle, rmw_handle, topic_name, depth)
def _handle_rclcpp_subscription_callback_added(self, event: Dict, metadata: EventMetadata) -> None:
def _handle_rclcpp_subscription_callback_added(
self, event: Dict, metadata: EventMetadata
) -> None:
handle = get_field(event, 'subscription_handle')
timestamp = metadata.timestamp
callback_object = get_field(event, 'callback')
self._data.add_callback_object(handle, timestamp, callback_object)
def _handle_rcl_service_init(self, event: Dict, metadata: EventMetadata) -> None:
def _handle_rcl_service_init(
self, event: Dict, metadata: EventMetadata
) -> None:
handle = get_field(event, 'service_handle')
timestamp = metadata.timestamp
node_handle = get_field(event, 'node_handle')
......@@ -119,13 +131,17 @@ class Ros2Processor(EventHandler):
service_name = get_field(event, 'service_name')
self._data.add_service(handle, timestamp, node_handle, rmw_handle, service_name)
def _handle_rclcpp_service_callback_added(self, event: Dict, metadata: EventMetadata) -> None:
def _handle_rclcpp_service_callback_added(
self, event: Dict, metadata: EventMetadata
) -> None:
handle = get_field(event, 'service_handle')
timestamp = metadata.timestamp
callback_object = get_field(event, 'callback')
self._data.add_callback_object(handle, timestamp, callback_object)
def _handle_rcl_client_init(self, event: Dict, metadata: EventMetadata) -> None:
def _handle_rcl_client_init(
self, event: Dict, metadata: EventMetadata
) -> None:
handle = get_field(event, 'client_handle')
timestamp = metadata.timestamp
node_handle = get_field(event, 'node_handle')
......@@ -133,30 +149,40 @@ class Ros2Processor(EventHandler):
service_name = get_field(event, 'service_name')
self._data.add_client(handle, timestamp, node_handle, rmw_handle, service_name)
def _handle_rcl_timer_init(self, event: Dict, metadata: EventMetadata) -> None:
def _handle_rcl_timer_init(
self, event: Dict, metadata: EventMetadata
) -> None:
handle = get_field(event, 'timer_handle')
timestamp = metadata.timestamp
period = get_field(event, 'period')
self._data.add_timer(handle, timestamp, period)
def _handle_rclcpp_timer_callback_added(self, event: Dict, metadata: EventMetadata) -> None:
def _handle_rclcpp_timer_callback_added(
self, event: Dict, metadata: EventMetadata
) -> None:
handle = get_field(event, 'timer_handle')
timestamp = metadata.timestamp
callback_object = get_field(event, 'callback')
self._data.add_callback_object(handle, timestamp, callback_object)
def _handle_rclcpp_callback_register(self, event: Dict, metadata: EventMetadata) -> None:
def _handle_rclcpp_callback_register(
self, event: Dict, metadata: EventMetadata
) -> None:
callback_object = get_field(event, 'callback')
timestamp = metadata.timestamp
symbol = get_field(event, 'symbol')
self._data.add_callback_symbol(callback_object, timestamp, symbol)
def _handle_callback_start(self, event: Dict, metadata: EventMetadata) -> None:
def _handle_callback_start(
self, event: Dict, metadata: EventMetadata
) -> None:
# Add to dict
callback_addr = get_field(event, 'callback')
self._callback_instances[callback_addr] = (event, metadata)
def _handle_callback_end(self, event: Dict, metadata: EventMetadata) -> None:
def _handle_callback_end(
self, event: Dict, metadata: EventMetadata
) -> None:
# Fetch from dict
callback_object = get_field(event, 'callback')
(event_start, metadata_start) = self._callback_instances.get(callback_object)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment