Skip to content

Commit 3c30351

Browse files
committed
update.
1 parent 31bee33 commit 3c30351

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

webrtc-sys/test/benchmark.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,11 @@ void Benchmark::Perform() {
189189
uint32_t cpuUsage = _cpu->CpuUsage();
190190
if (cpuUsage > 0) {
191191
currCpuUsage += cpuUsage;
192-
std::string str = "CPU Usage[%]:";
193-
str += " " + std::to_string(cpuUsage) + "%" +
194-
", Iteration: " + std::to_string(l + 1);
192+
int coreCount = _cpu->GetNumCores();
193+
std::string str = "CPU Usage[%]: cores ";
194+
str += std::to_string(coreCount);
195+
str += ", usage " + std::to_string(cpuUsage) + "%" +
196+
", Test Iteration: " + std::to_string(l + 1) + "/" + std::to_string(testIterations);
195197
std::cout << str << std::flush;
196198
for (int i = 0; i < str.length(); ++i) {
197199
std::cout << "\b";

webrtc-sys/test/cpu/cpu_linux.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ class CpuLinux : public CpuWrapper {
2828
void Reset() override { return; }
2929
void Stop() override { return; }
3030

31+
int GetNumCores() override;
32+
3133
private:
3234
int GetData(long long& busy,
3335
long long& idle,
3436
long long*& busyArray,
3537
long long*& idleArray);
36-
int GetNumCores();
38+
3739

3840
long long m_oldBusyTime;
3941
long long m_oldIdleTime;

webrtc-sys/test/cpu/cpu_wrapper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ class CpuWrapper
4646
virtual void Reset() = 0;
4747
virtual void Stop() = 0;
4848

49+
virtual int GetNumCores() = 0;
50+
4951
protected:
5052
CpuWrapper() {}
5153
};

0 commit comments

Comments
 (0)