aboutsummaryrefslogtreecommitdiff
path: root/crosperf/experiment_runner_unittest.py
diff options
context:
space:
mode:
authorDenis Nikitin <denik@google.com>2020-06-02 23:22:00 -0700
committerDenis Nikitin <denik@chromium.org>2020-06-05 04:47:44 +0000
commitad18d3390cf5da60b7143122d0f3789c91929183 (patch)
treeddf6317841f5fab8112f02cf2a22229062383641 /crosperf/experiment_runner_unittest.py
parent91c5578c0e8c1bf6aef5151de3b7738f46cee50b (diff)
downloadtoolchain-utils-ad18d3390cf5da60b7143122d0f3789c91929183.tar.gz
crosperf: Include PID in topstats
Top statistics was showing commands which could combined multiple processes. To include PID in topstats we need to split the commands into separate processes. The process PID is appended to the command name in topstats. The top chrome process is the renderer process running the benchmark. The list size depends on the number of non-chrome processes which we limit to 5. For example with 10 chrome processes in the top with 10 following non-chrome processes the list will show 15 entries. BUG=None TEST=Tested on eve, bob and cheza. Change-Id: Ibf1e61c8cb522aba13cd51a590bb7e24597f66a6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2227626 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Denis Nikitin <denik@chromium.org>
Diffstat (limited to 'crosperf/experiment_runner_unittest.py')
-rwxr-xr-xcrosperf/experiment_runner_unittest.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/crosperf/experiment_runner_unittest.py b/crosperf/experiment_runner_unittest.py
index 0bbab292..31d02e71 100755
--- a/crosperf/experiment_runner_unittest.py
+++ b/crosperf/experiment_runner_unittest.py
@@ -409,11 +409,11 @@ class ExperimentRunnerTest(unittest.TestCase):
@mock.patch.object(Result, 'CompressResultsTo')
@mock.patch.object(Result, 'CopyResultsTo')
@mock.patch.object(Result, 'CleanUp')
- @mock.patch.object(Result, 'FormatStringTop5')
+ @mock.patch.object(Result, 'FormatStringTopCommands')
@mock.patch('builtins.open', new_callable=mock.mock_open)
- def test_store_results(self, mock_open, mock_top5, mock_cleanup, mock_copy,
- mock_compress, _mock_text_report, mock_report,
- mock_writefile, mock_mkdir, mock_rmdir):
+ def test_store_results(self, mock_open, mock_top_commands, mock_cleanup,
+ mock_copy, mock_compress, _mock_text_report,
+ mock_report, mock_writefile, mock_mkdir, mock_rmdir):
self.mock_logger.Reset()
self.exp.results_directory = '/usr/local/crosperf-results'
@@ -441,7 +441,7 @@ class ExperimentRunnerTest(unittest.TestCase):
self.assertEqual(mock_rmdir.call_count, 0)
self.assertEqual(self.mock_logger.LogOutputCount, 0)
self.assertEqual(mock_open.call_count, 0)
- self.assertEqual(mock_top5.call_count, 0)
+ self.assertEqual(mock_top_commands.call_count, 0)
# Test 2. _terminated is false; everything works properly.
fake_result = Result(self.mock_logger, self.exp.labels[0], 'average',
@@ -470,7 +470,7 @@ class ExperimentRunnerTest(unittest.TestCase):
self.assertEqual(self.mock_logger.LogOutputCount, 5)
self.assertEqual(self.mock_logger.output_msgs, [
'Storing experiment file in /usr/local/crosperf-results.',
- 'Storing top5 statistics of each benchmark run into'
+ 'Storing top statistics of each benchmark run into'
' /usr/local/crosperf-results/topstats.log.',
'Storing results of each benchmark run.',
'Storing results report in /usr/local/crosperf-results.',
@@ -482,9 +482,9 @@ class ExperimentRunnerTest(unittest.TestCase):
'w')
mock_open().write.assert_called()
- # Check top5 calls with no arguments.
- top5calls = [mock.call()] * 6
- self.assertEqual(mock_top5.call_args_list, top5calls)
+ # Check top calls with no arguments.
+ topcalls = [mock.call()] * 6
+ self.assertEqual(mock_top_commands.call_args_list, topcalls)
# Test 3. Test compress_results.
self.exp.compress_results = True