diff options
author | 2015-10-11 14:42:24 +0200 | |
---|---|---|
committer | 2015-10-11 14:42:24 +0200 | |
commit | 6c7880b9881ed6690954f0c29259dd0b584b3970 (patch) | |
tree | f8d23267dc0e086f1c622418e8bf68a04d38e64d /src/stateless/cp/trex_stateless_port.h | |
parent | 3b827c9584c28d3f1f573e372f646edfe9f5f007 (diff) |
DP cores now inject a single packet as a dummy to see stats
Diffstat (limited to 'src/stateless/cp/trex_stateless_port.h')
-rw-r--r-- | src/stateless/cp/trex_stateless_port.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/stateless/cp/trex_stateless_port.h b/src/stateless/cp/trex_stateless_port.h index a19fd981..428d5aee 100644 --- a/src/stateless/cp/trex_stateless_port.h +++ b/src/stateless/cp/trex_stateless_port.h @@ -24,6 +24,27 @@ limitations under the License. #include <trex_stream.h> /** + * bandwidth measurement class + * + */ +class BWMeasure { +public: + BWMeasure(); + void reset(void); + double add(uint64_t size); + +private: + double calc_MBsec(uint32_t dtime_msec, + uint64_t dbytes); + +public: + bool m_start; + uint32_t m_last_time_msec; + uint64_t m_last_bytes; + double m_last_result; +}; + +/** * TRex stateless port stats * * @author imarom (24-Sep-15) @@ -33,9 +54,22 @@ class TrexPortStats { public: TrexPortStats() { m_stats = {0}; + + m_bw_tx_bps.reset(); + m_bw_rx_bps.reset(); + + m_bw_tx_pps.reset(); + m_bw_rx_pps.reset(); } public: + + BWMeasure m_bw_tx_bps; + BWMeasure m_bw_rx_bps; + + BWMeasure m_bw_tx_pps; + BWMeasure m_bw_rx_pps; + struct { double m_tx_bps; |