5 #ifndef __DDS__StatImpl__ 6 #define __DDS__StatImpl__ 14 #include <boost/accumulators/accumulators.hpp> 15 #include <boost/accumulators/statistics/count.hpp> 16 #include <boost/accumulators/statistics/max.hpp> 17 #include <boost/accumulators/statistics/mean.hpp> 18 #include <boost/accumulators/statistics/min.hpp> 19 #include <boost/accumulators/statistics/stats.hpp> 20 #include <boost/accumulators/statistics/sum.hpp> 21 #include <boost/asio.hpp> 27 namespace protocol_api
29 typedef boost::accumulators::accumulator_set<double,
30 boost::accumulators::features<boost::accumulators::tag::mean,
31 boost::accumulators::tag::max,
32 boost::accumulators::tag::count,
33 boost::accumulators::tag::sum>>
45 :
m_mean(std::numeric_limits<double>::min())
46 ,
m_max(std::numeric_limits<double>::min())
112 typedef std::deque<CProtocolMessage::protocolMessagePtr_t> protocolMessagePtrQueue_t;
116 : m_statEnabled(false)
118 , m_readMessageBytesAccumulator()
119 , m_readMessageBytesAccumulatorMap()
121 , m_writeMessageBytesAccumulator()
122 , m_writeQueueBytesAccumulator()
123 , m_writeQueueMessagesAccumulator()
124 , m_writeMessageBytesAccumulatorMap()
125 , m_ioContext(_context)
144 std::atomic<bool> m_statEnabled;
147 mutable std::mutex m_logReadMutex;
152 mutable std::mutex m_logWriteMutex;
158 boost::asio::io_context& m_ioContext;
SReadStat()
Definition: StatImpl.h:93
double m_sum
Definition: StatImpl.h:65
Definition: StatImpl.h:42
void logReadMessage(CProtocolMessage::protocolMessagePtr_t _message)
Definition: StatImpl.cpp:189
statParamsMap_t m_messageBytesMap
Definition: StatImpl.h:107
void addFromStatParams(const SStatParams &_stat)
Add statistics from another structure.
Definition: StatImpl.cpp:81
SStatParams m_queueBytes
Definition: StatImpl.h:86
double m_max
Definition: StatImpl.h:63
SStatParams m_messageBytes
Definition: StatImpl.h:85
SStatParams m_queueMessages
Definition: StatImpl.h:87
SReadStat getReadStat() const
Return read statistics.
Definition: StatImpl.cpp:154
SStatParams()
Definition: StatImpl.h:44
SWriteStat()
Definition: StatImpl.h:70
Definition: AgentConnectionManager.h:13
CStatImpl(boost::asio::io_context &_context)
Definition: StatImpl.h:115
std::map< uint16_t, statsAccumulator_t > statsAccumulatorMap_t
Definition: StatImpl.h:37
double m_mean
Definition: StatImpl.h:62
Definition: StatImpl.h:68
std::string toString() const
String representation of the object.
SWriteStat getWriteStat() const
Return write statistics.
Definition: StatImpl.cpp:168
double m_count
Definition: StatImpl.h:64
std::map< uint16_t, SStatParams > statParamsMap_t
Definition: StatImpl.h:39
void addFromStat(const SReadStat &_stat)
Add statistics from another structure.
Definition: StatImpl.cpp:133
void fillFromAccumulator(const statsAccumulator_t &_accumulator)
Definition: StatImpl.cpp:89
std::string toString() const
String representation of the object.
Definition: StatImpl.cpp:142
std::string toString() const
String representation of the object.
Definition: StatImpl.cpp:111
Definition: StatImpl.h:110
void setStatEnabled(bool _statEnabled)
Enable/disable statistics accumulation.
Definition: StatImpl.cpp:184
void addFromStat(const SWriteStat &_stat)
Add statistics from another structure.
Definition: StatImpl.cpp:100
boost::accumulators::accumulator_set< double, boost::accumulators::features< boost::accumulators::tag::mean, boost::accumulators::tag::max, boost::accumulators::tag::count, boost::accumulators::tag::sum > > statsAccumulator_t
Definition: StatImpl.h:34
statParamsMap_t m_messageBytesMap
Definition: StatImpl.h:88
Definition: StatImpl.h:91
SStatParams m_messageBytes
Definition: StatImpl.h:106
void logWriteMessages(const protocolMessagePtrQueue_t &_messageQueue)
Definition: StatImpl.cpp:205
std::shared_ptr< CProtocolMessage > protocolMessagePtr_t
Definition: ProtocolMessage.h:81