Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: docstring for method returning RecordsCppImpl and TracePointData #528

Merged
merged 14 commits into from
Sep 19, 2024
4 changes: 2 additions & 2 deletions src/caret_analyze/infra/lttng/lttng.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ def compose_intra_proc_comm_records(
RecordsInterface
Columns

- tid
- callback_object
- callback_start_timestamp
- publisher_handle
Expand All @@ -937,7 +938,6 @@ def compose_callback_records(

- callback_start_timestamp
- callback_end_timestamp
- is_intra_process
- callback_object

"""
Expand Down Expand Up @@ -990,7 +990,7 @@ def compose_path_beginning_records(
- callback_start_timestamp
- rclcpp_publish_timestamp
- callback_object
- publisher_object
- publisher_handle

"""
return self._source.path_beginning_records.clone()
30 changes: 24 additions & 6 deletions src/caret_analyze/infra/lttng/lttng_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,14 +870,15 @@ def timer_callbacks(self) -> TracePointData:
-------
pd.DataFrame
Column

- callback_id
- callback_object
- node_handle
- timer_handle
- callback_group_addr
- period_ns,
- symbol
- construction_order
- callback_id

"""
return self._timer_callbacks
Expand All @@ -895,16 +896,17 @@ def subscription_callbacks(self) -> TracePointData:
-------
pd.DataFrame
columns

- callback_id
- callback_object
- callback_object_intra
- node_handle
- subscription_handle
- callback_group_addr
- topic_name
- symbol
- construction_order
- callback_id
- depth
- construction_order

"""
return self._sub_callbacks
Expand All @@ -922,11 +924,12 @@ def service_callbacks(self) -> TracePointData:
-------
pd.DataFrame
Columns

- callback_id
- callback_object
- callback_group_addr
- node_handle
- service_handle
- callback_group_addr
- service_name
- symbol
- construction_order
Expand All @@ -947,6 +950,8 @@ def nodes(self) -> TracePointData:
-------
pd.DataFrame
Columns

- node_id
- node_handle
- node_name

Expand All @@ -962,6 +967,8 @@ def publishers(self) -> TracePointData:
-------
pd.DataFrame
Columns

- publisher_id
- publisher_handle
- node_handle
- topic_name
Expand All @@ -980,6 +987,8 @@ def subscriptions(self) -> TracePointData:
-------
pd.DataFrame
Columns

- subscription_id
- subscription_handle
- node_handle
- topic_name
Expand All @@ -998,6 +1007,8 @@ def services(self) -> TracePointData:
-------
pd.DataFrame
Columns

- service_id
- service_handle
- node_handle
- service_name
Expand All @@ -1015,6 +1026,8 @@ def timers(self) -> TracePointData:
-------
pd.DataFrame
Columns

- timer_id
- timer_handle
- node_handle
- period
Expand All @@ -1032,11 +1045,13 @@ def executor(self) -> TracePointData:
-------
pd.DataFrame
Columns

- executor_id
- executor_addr
- executor_type_name

"""
return self._executor_df.clone()
return self._executor_df

@property
def callback_groups(self) -> TracePointData:
Expand All @@ -1047,10 +1062,11 @@ 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
Expand All @@ -1064,7 +1080,9 @@ def tilde_publishers(self) -> TracePointData:
-------
pd.DataFrame
Columns

- tilde_publisher
- tilde_subscription
- node_name
- topic_name

Expand Down
43 changes: 42 additions & 1 deletion src/caret_analyze/infra/lttng/records_provider_lttng.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,17 @@ def communication_records(
RecordsInterface
Columns

If inter-proc communication

- [topic_name]/rclcpp_publish_timestamp
- [topic_name]/rcl_publish_timestamp (Optional)
- [topic_name]/dds_publish_timestamp (Optional)
- [topic_name]/source_timestamp (only inter process)
- [topic_name]/source_timestamp
- [callback_name]/callback_start_timestamp

If intra-proc communication

- [topic_name]/rclcpp_publish_timestamp
- [callback_name]/callback_start_timestamp

"""
Expand Down Expand Up @@ -733,6 +740,7 @@ def path_beginning_records(
-------
RecordsInterface
Columns

- [node_name]/callback_start_timestamp
- [topic_name]/rclcpp_publish_timestamp

Expand Down Expand Up @@ -764,6 +772,7 @@ def path_end_records(
-------
RecordsInterface
Columns

- [callback_name]/callback_start_timestamp
- [callback_name]/callback_end_timestamp

Expand Down Expand Up @@ -1570,6 +1579,13 @@ 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:
Expand Down Expand Up @@ -1613,6 +1629,16 @@ 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)
Expand Down Expand Up @@ -1678,6 +1704,14 @@ 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
Expand Down Expand Up @@ -1856,6 +1890,13 @@ 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(
Expand Down
3 changes: 2 additions & 1 deletion src/caret_analyze/infra/lttng/records_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -701,10 +701,11 @@ def path_beginning_records(self) -> RecordsInterface:
-------
RecordsInterface
columns:

- callback_start_timestamp
- rclcpp_publish_timestamp
- callback_object
- publisher_object
- publisher_handle
ymski marked this conversation as resolved.
Show resolved Hide resolved

"""
records_inter: RecordsInterface
Expand Down
Loading