New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 688160 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Add cpu consumption and other metrics to autotests, for use during wifi_perf

Project Member Reported by kirtika@chromium.org, Feb 2 2017

Issue description

OS: M57

The throughput numbers from wifi_perf leave us with more questions than answers - rx is lower than tx on Intel, but higher on some ARM platforms. 
Per past discussions, it would be good to simultaneously capture cpu (memory too?) stats during wifi_perf tests to check for system anomalies.
Please comment on the below:

- There is the existing performance_Tracker.py that rohitbm@
wrote. Augmenting/replacing it is one option. 
Issues - likely doesn't run multithreaded (it was intended to run stand-alone while the user tinkered with the device manually), doesn't use psutil that would make it nicer. 

- I'd like to write something similar to netperf_session.py / netperf_runner.py - the class abstracts all details of capturing data akin to these files, the users of the class (akin to wifi_perf tests) just call it with start, stop and what to capture. 


 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/bbcc1c9f3477a602e485c17d65c44aea900903a9

commit bbcc1c9f3477a602e485c17d65c44aea900903a9
Author: Satya Tangirala <satyat@google.com>
Date: Fri Aug 11 03:24:12 2017

autotest: Resource Monitor Framework.

Framework to monitor CPU and memory use. Saves top output periodically
on the client and extracts cpu/memory usage metrics when asked to do so.
Also, saves the raw top output on the server.

BUG=chromium:688160
TEST=resource_monitor_unittest.py

Change-Id: I613f6807bf85a08d6292455eb5794cd5988a2881
Reviewed-on: https://chromium-review.googlesource.com/576667
Commit-Ready: Satya Tangirala <satyat@google.com>
Tested-by: Satya Tangirala <satyat@google.com>
Reviewed-by: Abhishek Bhardwaj <abhishekbh@google.com>

[add] https://crrev.com/bbcc1c9f3477a602e485c17d65c44aea900903a9/server/cros/resource_monitor_unittest.py
[add] https://crrev.com/bbcc1c9f3477a602e485c17d65c44aea900903a9/server/cros/resource_monitor.py
[add] https://crrev.com/bbcc1c9f3477a602e485c17d65c44aea900903a9/server/cros/res_resource_monitor/top_whitespace_ridden.txt
[add] https://crrev.com/bbcc1c9f3477a602e485c17d65c44aea900903a9/server/cros/res_resource_monitor/top_test_data_ans.csv
[add] https://crrev.com/bbcc1c9f3477a602e485c17d65c44aea900903a9/server/cros/res_resource_monitor/top_field_order_changed_ans.csv
[add] https://crrev.com/bbcc1c9f3477a602e485c17d65c44aea900903a9/server/cros/res_resource_monitor/top_field_order_changed.txt
[add] https://crrev.com/bbcc1c9f3477a602e485c17d65c44aea900903a9/server/cros/res_resource_monitor/top_whitespace_ridden_ans.csv
[add] https://crrev.com/bbcc1c9f3477a602e485c17d65c44aea900903a9/server/cros/res_resource_monitor/top_test_data.txt

Cc: briannorris@chromium.org

Comment 3 by yoshi@chromium.org, Jan 3 2018

Cc: -yoshi@chromium.org
Cc: kirtika@chromium.org akhouderchah@chromium.org
 Issue 856298  has been merged into this issue.
Cc: harpreet@chromium.org
Owner: akhouderchah@chromium.org
IIRC, we never settled on what we wanted to add in the netperf tests. 
satyat@ merged this CL, then Harpreet (or someone else) pointed out that autotest already has similar functionality. They were probably pointing to get_cpu_usage()
function in client/bin/utils.py.

Will let Alex make the call on which works best for us. 

I vaguely recall Alex using a netperf command line option to get CPU utilization stats. Alex, reading through the CPU utilization part in the netperf manual (https://hewlettpackard.github.io/netperf/doc/netperf.html#CPU-Utilization)
I am not sure if there's a reliable way to get this, or if we build netperf with that option enabled in --configure. 
"The /proc/stat mechanism under Linux is in what the author would consider an “uncertain” category as it appears to be statistical, which may also have issues with time spent processing interrupts.
In summary, be sure to “sanity-check” the CPU utilization figures with other mechanisms. However, platform tools such as top, vmstat or mpstat are often based on the same mechanisms used by netperf."

If you do go through this route, please double-check utilization numbers with
"turbostat --quiet" output.

If netperf is run with the '-cC' options, we can get both server and client-side CPU utilization. Unfortunately, netperf only provides a single percentage per machine, which doesn't offer much insight when a system has 4 cores. My solution was to simply get the /proc/stat values of the machines through autotest right before and after running netperf, such that we could calculate the utilization values of each core separately. Although it seemed like netperf could provide more accurate numbers, as it collects the initial /proc/stat values after initialization, the difference on average between the two methods was less than a percentage point.

That being said, I will play around with different methods and see the discrepancies between values.

Sign in to add a comment