5 #ifndef __DDS__StatImpl__ 6 #define __DDS__StatImpl__ 12 #pragma clang diagnostic push 13 #pragma clang diagnostic ignored "-Wunused-local-typedef" 14 #pragma clang diagnostic ignored "-Wdeprecated-declarations" 15 #include <boost/accumulators/accumulators.hpp> 16 #include <boost/accumulators/statistics/count.hpp> 17 #include <boost/accumulators/statistics/max.hpp> 18 #include <boost/accumulators/statistics/mean.hpp> 19 #include <boost/accumulators/statistics/min.hpp> 20 #include <boost/accumulators/statistics/stats.hpp> 21 #include <boost/accumulators/statistics/sum.hpp> 22 #include <boost/asio.hpp> 23 #pragma clang diagnostic pop 29 namespace protocol_api
31 typedef boost::accumulators::accumulator_set<double,
32 boost::accumulators::features<boost::accumulators::tag::mean,
33 boost::accumulators::tag::max,
34 boost::accumulators::tag::count,
35 boost::accumulators::tag::sum>>
47 :
m_mean(
std::numeric_limits<double>::min())
48 ,
m_max(
std::numeric_limits<double>::min())
102 void addFromStat(
const SReadStat& _stat);
114 typedef std::deque<CProtocolMessage::protocolMessagePtr_t> protocolMessagePtrQueue_t;
118 : m_statEnabled(false)
120 , m_readMessageBytesAccumulator()
121 , m_readMessageBytesAccumulatorMap()
123 , m_writeMessageBytesAccumulator()
124 , m_writeQueueBytesAccumulator()
125 , m_writeQueueMessagesAccumulator()
126 , m_writeMessageBytesAccumulatorMap()
127 , m_io_service(_service)
138 void setStatEnabled(
bool _statEnabled);
142 void logWriteMessages(
const protocolMessagePtrQueue_t& _messageQueue);
146 std::atomic<bool> m_statEnabled;
149 mutable std::mutex m_logReadMutex;
151 statsAccumulatorMap_t m_readMessageBytesAccumulatorMap;
154 mutable std::mutex m_logWriteMutex;
158 statsAccumulatorMap_t m_writeMessageBytesAccumulatorMap;
160 boost::asio::io_service& m_io_service;
SReadStat()
Definition: StatImpl.h:95
double m_sum
Definition: StatImpl.h:67
Definition: StatImpl.h:44
statParamsMap_t m_messageBytesMap
Definition: StatImpl.h:109
void addFromStatParams(const SStatParams &_stat)
Add statistics from another structure.
Definition: StatImpl.cpp:81
SStatParams m_queueBytes
Definition: StatImpl.h:88
double m_max
Definition: StatImpl.h:65
SStatParams m_messageBytes
Definition: StatImpl.h:87
SStatParams m_queueMessages
Definition: StatImpl.h:89
SStatParams()
Definition: StatImpl.h:46
SWriteStat()
Definition: StatImpl.h:72
Definition: dds-agent/src/AgentConnectionManager.h:16
std::map< uint16_t, statsAccumulator_t > statsAccumulatorMap_t
Definition: StatImpl.h:39
double m_mean
Definition: StatImpl.h:64
Definition: StatImpl.h:70
std::string toString() const
String representation of the object.
double m_count
Definition: StatImpl.h:66
std::map< uint16_t, SStatParams > statParamsMap_t
Definition: StatImpl.h:41
void fillFromAccumulator(const statsAccumulator_t &_accumulator)
Definition: StatImpl.cpp:89
Definition: StatImpl.h:112
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:36
statParamsMap_t m_messageBytesMap
Definition: StatImpl.h:90
Definition: StatImpl.h:93
SStatParams m_messageBytes
Definition: StatImpl.h:108
CStatImpl(boost::asio::io_service &_service)
Definition: StatImpl.h:117
std::shared_ptr< CProtocolMessage > protocolMessagePtr_t
Definition: ProtocolMessage.h:69