13 #include <scene_rdl2/common/platform/Platform.h> 14 #include <scene_rdl2/common/rec_time/RecTime.h> 23 mRecvMsgIntervalAll(0.0f),
24 mRecvMsgIntervalTotal(0),
35 void updateMsgInterval();
42 void updateLatency(
const float latencySec);
49 void updateRecvMsgSize(
const uint64_t byte);
61 std::string show(
const float elapsedSecFromStart)
const;
65 uint64_t mLatencyTotal;;
67 scene_rdl2::rec_time::RecTime mRecvMsgIntervalTime;
68 float mRecvMsgIntervalAll;
69 uint64_t mRecvMsgIntervalTotal;
71 uint64_t mRecvMsgSizeAll;
72 uint64_t mRecvMsgSizeTotal;
76 float calcAveLatency()
const {
77 return (mLatencyTotal)? (mLatencyAll / (float)mLatencyTotal * 1000.0f): 0.0f;
79 finline
float calcFps()
const;
80 finline
float calcBps()
const;
81 finline uint64_t calcAveRecvMsgSize()
const;
82 std::string byteStr(
const uint64_t size)
const;
83 std::string bpsStr(
const float bps)
const;
87 ClientReceiverStats::reset()
91 mRecvMsgIntervalAll = 0.0f;
92 mRecvMsgIntervalTotal = 0;
94 mRecvMsgSizeTotal = 0;
98 ClientReceiverStats::calcFps()
const 100 if (mRecvMsgIntervalAll > 0.0f && mRecvMsgIntervalTotal > 0) {
101 return (1.0f / (mRecvMsgIntervalAll / (
float)mRecvMsgIntervalTotal));
107 ClientReceiverStats::calcBps()
const 109 if (mRecvMsgIntervalAll > 0.0f) {
110 return (
float)mRecvMsgSizeAll / mRecvMsgIntervalAll;
116 ClientReceiverStats::calcAveRecvMsgSize()
const 118 if (mRecvMsgSizeTotal) {
119 return mRecvMsgSizeAll / mRecvMsgSizeTotal;
Definition: ClientReceiverStats.h:18
Definition: ClientReceiverConsoleDriver.cc:9