Template Class ReceivedMessageAgeCollector

Inheritance Relationships

Base Type

Class Documentation

template<typename T>
class ReceivedMessageAgeCollector : public libstatistics_collector::topic_statistics_collector::TopicStatisticsCollector<T>

Class used to measure the received messsage, tparam T, age from a ROS2 subscriber.

Template Parameters

T – the message type to receive from the subscriber / listener

Public Functions

ReceivedMessageAgeCollector() = default
virtual ~ReceivedMessageAgeCollector() = default
inline virtual void OnMessageReceived(const T &received_message, const rcl_time_point_value_t now_nanoseconds) override

Handle a new incoming message. Calculate message age if a valid Header is present.

Parameters
  • received_message – the message to calculate age of.

  • now_nanoseconds – time the message was received in nanoseconds

inline virtual std::string GetMetricName() const override

Return message age metric name

Returns

a string representing message age metric name

inline virtual std::string GetMetricUnit() const override

Return messge age metric unit

Returns

a string representing messager age metric unit

Protected Functions

inline virtual bool SetupStart() override

Override in order to perform necessary starting steps.

Returns

true if setup was successful, false otherwise.

inline virtual bool SetupStop() override

Override in order to perform necessary teardown.

Returns

true if teardown was successful, false otherwise.