On this page

MetricsMessagePublisher QML Type

Publishes statistics_msgs::msg::MetricsMessage messages — A generic metrics message providing statistics for measurements from different sources. For example, measure a system's CPU % for a given window yields the following data points over a window of time:. More...

Import Statement: import QtRos2.StatisticsMsgs
Inherits:

PublisherBase

Status: Experimental Extension

Properties

Methods

Detailed Description

  • average cpu %
  • std deviation
  • min
  • max
  • sample count

These are all represented as different 'StatisticDataPoint's.

MetricsMessagePublisher publishes metricsMessage values to a ROS 2 topic. Set the topic and node properties, then call publish() to send messages.

See also MetricsMessageSubscriber and metricsMessage.

Property Documentation

measurementSourceName : string

The measurementSourceName field value included in the next publish. Setting this property emits measurementSourceNameChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

metricsSource : string

The metricsSource field value included in the next publish. Setting this property emits metricsSourceChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

statistics : list<statisticDataPoint>

The statistics field value included in the next publish. Setting this property emits statisticsChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

unit : string

The unit field value included in the next publish. Setting this property emits unitChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

windowStart : time

The windowStart field value included in the next publish. Setting this property emits windowStartChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

windowStop : time

The windowStop field value included in the next publish. Setting this property emits windowStopChanged and, when autoPublish is true, requests a publish at the end of the current event-loop iteration.

Method Documentation

void publish(metricsMessage msg)

Publishes metricsMessage msg to the ROS 2 topic set by the topic property. Does nothing if the publisher is not connected.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.