Function libstatistics_collector::collector::GenerateStatisticMessage

Function Documentation

statistics_msgs::msg::MetricsMessage libstatistics_collector::collector::GenerateStatisticMessage(const std::string &node_name, const std::string &metric_name, const std::string &unit, const builtin_interfaces::msg::Time window_start, const builtin_interfaces::msg::Time window_stop, const libstatistics_collector::moving_average_statistics::StatisticData &data)

Return a valid MetricsMessage ready to be published to a ROS topic

Parameters
  • node_name – the name of the node that the data originates from

  • metric_name – the name of the metric (“cpu_usage”, “memory_usage”, etc.)

  • unit – name of the unit (“percentage”, “mb”, etc.)

  • window_start – measurement window start time

  • window_stop – measurement window end time

  • data – statistics derived from the measurements made in the window

Returns

a MetricsMessage containing the statistics in the data parameter