ros2_tracing_cpp icon indicating copy to clipboard operation
ros2_tracing_cpp copied to clipboard

FEAT: Add topic statistics with rcl_publisher_init and rclcpp_publish

Open wkaisertexas opened this issue 1 year ago • 0 comments

rcl_publisher_init and rclcpp_publish

DEFINE_TRACEPOINT(
  rcl_publisher_init,
  TRACEPOINT_PARAMS(
    const void * publisher_handle,
    const void * node_handle,
    const void * rmw_publisher_handle,
    const char * topic_name,
    const size_t queue_depth),
  TRACEPOINT_ARGS(
    publisher_handle,
    node_handle,
    rmw_publisher_handle,
    topic_name,
    queue_depth))

DEFINE_TRACEPOINT(
  rclcpp_publish,
  TRACEPOINT_PARAMS(
    const void * publisher_handle,
    const void * message),
  TRACEPOINT_ARGS(
    message))

When a trace is collected, rcl_publisher_init creates a publisher with a topic_name and a unique handle. After this, topic statics about the frequency of published messages can also be collected. This is basically mcap info, but a trace-based way to get these same statistics could potentially be useful

wkaisertexas avatar Dec 02 '24 21:12 wkaisertexas