Go to the documentation of this file.
17 #ifndef GZ_TRANSPORT_TOPICSTATISTICS_HH_
18 #define GZ_TRANSPORT_TOPICSTATISTICS_HH_
20 #include <gz/msgs/statistic.pb.h>
26 #include "gz/transport/config.hh"
27 #include "gz/transport/Export.hh"
45 inline namespace IGNITION_TRANSPORT_VERSION_NAMESPACE {
48 class TopicStatisticsPrivate;
62 public:
void Update(
double _stat);
66 public:
double Avg()
const;
70 public:
double StdDev()
const;
74 public:
double Min()
const;
78 public:
double Max()
const;
82 public: uint64_t Count()
const;
85 private: uint64_t count = 0;
88 private:
double average = 0;
92 private:
double sumSquareMeanDist = 0;
130 uint64_t _stamp, uint64_t _seq);
135 public:
void FillMessage(msgs::Metric &_msg)
const;
139 public: uint64_t DroppedMsgCount()
const;
143 public:
Statistics PublicationStatistics()
const;
147 public:
Statistics ReceptionStatistics()
const;
155 #pragma warning(push)
156 #pragma warning(disable: 4251)
Encapsulates statistics for a single topic. The set of statistics include:
Definition: gz/transport/TopicStatistics.hh:113
Definition: gz/transport/AdvertiseOptions.hh:28
Statistics()=default
Default constructor.
double StdDev() const
Get the standard deviation.
void Update(const std::string &_sender, uint64_t _stamp, uint64_t _seq)
Update the topic statistics.
Computes the rolling average, min, max, and standard deviation for a set of samples.
Definition: gz/transport/TopicStatistics.hh:52
double Min() const
Get the minimum sample value.
double Avg() const
Get the average value.
Statistics ReceptionStatistics() const
Get the statistics about reception of messages.
~TopicStatistics()
Default destructor.
void FillMessage(msgs::Metric &_msg) const
Populate an gz::msgs::Metric message with topic statistics.
~Statistics()=default
Default destructor.
void Update(double _stat)
Update with a new sample.
Statistics PublicationStatistics() const
Get statistics about publication of messages.
Statistics AgeStatistics() const
Get the message age statistics.
double Max() const
Get the maximum sample value.
TopicStatistics()
Default constructor.
uint64_t Count() const
Get the number of samples.
uint64_t DroppedMsgCount() const
Get the number of dropped messages.