diff options
author | 2016-07-04 15:52:30 +0300 | |
---|---|---|
committer | 2016-07-04 15:52:30 +0300 | |
commit | 740095d6413bb26e8e76d00fdd2321c2bc9cd14f (patch) | |
tree | 655b3731a69be55c9649d4d95d7bd2bf03d95040 /src/utl_cpuu.h | |
parent | 483dfb7c5021d7dc9e2c7f10c9b76101441c7203 (diff) | |
parent | e2b4f166726e8e2149a2a0ddd763fa8d44055844 (diff) |
Merge branch 'cpu_per_core'
Diffstat (limited to 'src/utl_cpuu.h')
-rwxr-xr-x | src/utl_cpuu.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/utl_cpuu.h b/src/utl_cpuu.h index e5305783..109fff4f 100755 --- a/src/utl_cpuu.h +++ b/src/utl_cpuu.h @@ -22,6 +22,8 @@ limitations under the License. */ #include <stdint.h> +#include <cstring> +#include "trex_defs.h" #include "os_time.h" #include "mbuf.h" @@ -56,13 +58,18 @@ public: void Update(); /* return cpu % */ double GetVal(); - + uint8_t GetValRaw(); + void GetHistory(cpu_vct_t &cpu_vct); private: - CCpuUtlDp * m_dpcpu; - uint16_t m_ticks; - uint16_t m_work; + void AppendHistory(uint8_t); + CCpuUtlDp * m_dpcpu; + uint8_t m_ticks; + uint8_t m_work; - double m_cpu_util; + static const int m_history_size=20; + uint8_t m_cpu_util[m_history_size]; // history as cyclic array + uint8_t m_history_latest_index; + double m_cpu_util_lpf; }; #endif |