Go to the documentation of this file.
17 #ifndef IGN_TRANSPORT_TOPICSTATISTICS_HH_
18 #define IGN_TRANSPORT_TOPICSTATISTICS_HH_
20 #include <ignition/msgs/statistic.pb.h>
25 #include "ignition/transport/config.hh"
26 #include "ignition/transport/Export.hh"
33 inline namespace IGNITION_TRANSPORT_VERSION_NAMESPACE {
36 class TopicStatisticsPrivate;
50 public:
void Update(
double _stat);
54 public:
double Avg()
const;
58 public:
double StdDev()
const;
62 public:
double Min()
const;
66 public:
double Max()
const;
70 public: uint64_t Count()
const;
73 private: uint64_t count = 0;
76 private:
double average = 0;
80 private:
double sumSquareMeanDist = 0;
118 uint64_t _stamp, uint64_t _seq);
123 public:
void FillMessage(msgs::Metric &_msg)
const;
127 public: uint64_t DroppedMsgCount()
const;
131 public:
Statistics PublicationStatistics()
const;
135 public:
Statistics ReceptionStatistics()
const;
143 #pragma warning(push)
144 #pragma warning(disable: 4251)
Encapsulates statistics for a single topic. The set of statistics include:
Definition: TopicStatistics.hh:101
Definition: 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: TopicStatistics.hh:40
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 ignition::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.