From ad59288e66e3d1c23717f63f76c22b648cc272af Mon Sep 17 00:00:00 2001 From: h-suzuki Date: Fri, 6 Sep 2024 18:06:02 +0900 Subject: [PATCH] refactor: docstring Signed-off-by: h-suzuki --- src/caret_analyze/infra/lttng/lttng.py | 3 +- src/caret_analyze/infra/lttng/lttng_info.py | 17 +++++--- .../infra/lttng/records_provider_lttng.py | 39 ++++++++++++++++++- .../infra/lttng/records_source.py | 2 +- 4 files changed, 52 insertions(+), 9 deletions(-) diff --git a/src/caret_analyze/infra/lttng/lttng.py b/src/caret_analyze/infra/lttng/lttng.py index 4603d1bad..cd34c4717 100644 --- a/src/caret_analyze/infra/lttng/lttng.py +++ b/src/caret_analyze/infra/lttng/lttng.py @@ -914,7 +914,7 @@ def compose_intra_proc_comm_records( ------- RecordsInterface Columns - + - tid - callback_object - callback_start_timestamp - publisher_handle @@ -937,7 +937,6 @@ def compose_callback_records( - callback_start_timestamp - callback_end_timestamp - - is_intra_process - callback_object """ diff --git a/src/caret_analyze/infra/lttng/lttng_info.py b/src/caret_analyze/infra/lttng/lttng_info.py index f1d21bf9e..730f91e48 100644 --- a/src/caret_analyze/infra/lttng/lttng_info.py +++ b/src/caret_analyze/infra/lttng/lttng_info.py @@ -870,6 +870,7 @@ def timer_callbacks(self) -> TracePointData: ------- pd.DataFrame Column + - callback_id - callback_object - node_handle - timer_handle @@ -877,7 +878,6 @@ def timer_callbacks(self) -> TracePointData: - period_ns, - symbol - construction_order - - callback_id """ return self._timer_callbacks @@ -895,6 +895,7 @@ def subscription_callbacks(self) -> TracePointData: ------- pd.DataFrame columns + - callback_id - callback_object - callback_object_intra - node_handle @@ -902,9 +903,8 @@ def subscription_callbacks(self) -> TracePointData: - callback_group_addr - topic_name - symbol - - construction_order - - callback_id - depth + - construction_order """ return self._sub_callbacks @@ -924,9 +924,9 @@ def service_callbacks(self) -> TracePointData: Columns - callback_id - callback_object - - callback_group_addr - node_handle - service_handle + - callback_group_addr - service_name - symbol - construction_order @@ -947,6 +947,7 @@ def nodes(self) -> TracePointData: ------- pd.DataFrame Columns + - node_id - node_handle - node_name @@ -962,6 +963,7 @@ def publishers(self) -> TracePointData: ------- pd.DataFrame Columns + - publisher_id - publisher_handle - node_handle - topic_name @@ -980,6 +982,7 @@ def subscriptions(self) -> TracePointData: ------- pd.DataFrame Columns + - subscription_id - subscription_handle - node_handle - topic_name @@ -998,6 +1001,7 @@ def services(self) -> TracePointData: ------- pd.DataFrame Columns + - service_id - service_handle - node_handle - service_name @@ -1015,6 +1019,7 @@ def timers(self) -> TracePointData: ------- pd.DataFrame Columns + - timer_id - timer_handle - node_handle - period @@ -1032,6 +1037,7 @@ def executor(self) -> TracePointData: ------- pd.DataFrame Columns + - executor_id - executor_addr - executor_type_name @@ -1047,10 +1053,10 @@ def callback_groups(self) -> TracePointData: ------- pd.DataFrame Columns + - callback_group_id - callback_group_addr - executor_addr - group_type_name - - callback_group_id """ return self._cbg @@ -1065,6 +1071,7 @@ def tilde_publishers(self) -> TracePointData: pd.DataFrame Columns - tilde_publisher + - tilde_subscription - node_name - topic_name diff --git a/src/caret_analyze/infra/lttng/records_provider_lttng.py b/src/caret_analyze/infra/lttng/records_provider_lttng.py index cc8ca97cb..0af881751 100644 --- a/src/caret_analyze/infra/lttng/records_provider_lttng.py +++ b/src/caret_analyze/infra/lttng/records_provider_lttng.py @@ -82,7 +82,7 @@ def communication_records( comm_val : CommunicationStructValue communication value. - Returns + Returns (inter procces communication) ------- RecordsInterface Columns @@ -92,6 +92,15 @@ def communication_records( - [topic_name]/dds_publish_timestamp (Optional) - [topic_name]/source_timestamp (only inter process) - [callback_name]/callback_start_timestamp + ------- + + Returns (intra procces communication) + ------- + RecordsInterface + Columns + + - [topic_name]/rclcpp_publish_timestamp + - [callback_name]/callback_start_timestamp """ assert comm_val.subscribe_callback_name is not None @@ -1570,6 +1579,12 @@ def sub_records( ] ) + columns: + - callback_start_timestamp + - callback_object + - is_intra_process + - source_timestamp + """ grouped_records = self._grouped_sub_records if len(grouped_records) == 0: @@ -1613,6 +1628,15 @@ def inter_comm_records( Returns ------- RecordsInterface + columns: + - callback_object + - callback_start_timestamp + - publisher_handle + - rclcpp_publish_timestamp + - rcl_publish_timestamp (Optional) + - dds_write_timestamp (Optional) + - message_timestamp + - source_timestamp """ pub_records = self.publish_records(publisher_handles) @@ -1678,6 +1702,13 @@ def intra_comm_records( x.get('publisher_handle') in publisher_handles ) + columns: + - callback_object + - callback_start_timestamp + - publisher_handle + - rclcpp_publish_timestamp + - message_timestamp + """ grouped_records = self._grouped_intra_comm_records @@ -1856,6 +1887,12 @@ def callback_records( lambda x: x.['callback_object] in [inter_callback_object, intra_callback_object] ) + columns: + - callback_start_timestamp + - callback_end_timestamp + - is_intra_process + - callback_object + """ records = self._grouped_callback_records callback_records = RecordsFactory.create_instance( diff --git a/src/caret_analyze/infra/lttng/records_source.py b/src/caret_analyze/infra/lttng/records_source.py index 90a1fc55c..cd69f7b1f 100644 --- a/src/caret_analyze/infra/lttng/records_source.py +++ b/src/caret_analyze/infra/lttng/records_source.py @@ -704,7 +704,7 @@ def path_beginning_records(self) -> RecordsInterface: - callback_start_timestamp - rclcpp_publish_timestamp - callback_object - - publisher_object + - publisher_handle """ records_inter: RecordsInterface