summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorjbudorick@chromium.org <jbudorick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-26 19:22:49 +0000
committerjbudorick@chromium.org <jbudorick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-26 19:22:49 +0000
commit960a63c33e148348a8b8c65e4b8a91b868c12839 (patch)
tree2f2e180d50ae09af0e3960c2b22762aecc2082bf /build
parent4ba5bd508b64a28c01bc696542eeb0a1b74d9b64 (diff)
downloadchromium_src-960a63c33e148348a8b8c65e4b8a91b868c12839.zip
chromium_src-960a63c33e148348a8b8c65e4b8a91b868c12839.tar.gz
chromium_src-960a63c33e148348a8b8c65e4b8a91b868c12839.tar.bz2
[Android] Lint pylib/perf.
BUG=168518 Review URL: https://codereview.chromium.org/178003004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253549 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/android/pylib/perf/setup.py9
-rw-r--r--build/android/pylib/perf/surface_stats_collector.py5
-rw-r--r--build/android/pylib/perf/surface_stats_collector_unittest.py4
-rw-r--r--build/android/pylib/perf/test_runner.py2
-rw-r--r--build/android/pylib/perf/thermal_throttle.py21
5 files changed, 23 insertions, 18 deletions
diff --git a/build/android/pylib/perf/setup.py b/build/android/pylib/perf/setup.py
index 0d07c96..cf84456 100644
--- a/build/android/pylib/perf/setup.py
+++ b/build/android/pylib/perf/setup.py
@@ -6,19 +6,14 @@
import json
import fnmatch
-import logging
import os
-import psutil
-import signal
import shutil
-import time
from pylib import constants
from pylib import forwarder
+from pylib.perf import test_runner
from pylib.utils import test_environment
-import test_runner
-
def Setup(test_options):
"""Create and return the test runner factory and tests.
@@ -64,7 +59,7 @@ def Setup(test_options):
with file(test_options.flaky_steps, 'r') as f:
flaky_steps = json.load(f)
- def TestRunnerFactory(device, shard_index):
+ def TestRunnerFactory(device, _shard_index):
return test_runner.TestRunner(
test_options, device, tests_dict, flaky_steps)
diff --git a/build/android/pylib/perf/surface_stats_collector.py b/build/android/pylib/perf/surface_stats_collector.py
index 9d92b43..f979117 100644
--- a/build/android/pylib/perf/surface_stats_collector.py
+++ b/build/android/pylib/perf/surface_stats_collector.py
@@ -71,7 +71,8 @@ class SurfaceStatsCollector(object):
def GetResults(self):
return self._results or self._GetEmptyResults()
- def _GetEmptyResults(self):
+ @staticmethod
+ def _GetEmptyResults():
return [
SurfaceStatsCollector.Result('refresh_period', None, 'seconds'),
SurfaceStatsCollector.Result('jank_count', None, 'janks'),
@@ -102,7 +103,7 @@ class SurfaceStatsCollector(object):
frame_count = len(frame_lengths) + 1
if len(frame_lengths) == 0:
raise Exception('No valid frames lengths found.')
- length_changes, normalized_changes = \
+ _, normalized_changes = \
SurfaceStatsCollector._GetNormalizedDeltas(
frame_lengths, refresh_period)
jankiness = [max(0, round(change)) for change in normalized_changes]
diff --git a/build/android/pylib/perf/surface_stats_collector_unittest.py b/build/android/pylib/perf/surface_stats_collector_unittest.py
index 982b55d..e905d73 100644
--- a/build/android/pylib/perf/surface_stats_collector_unittest.py
+++ b/build/android/pylib/perf/surface_stats_collector_unittest.py
@@ -3,10 +3,12 @@
# found in the LICENSE file.
"""Unittests for SurfaceStatsCollector."""
+# pylint: disable=W0212
import unittest
-from surface_stats_collector import SurfaceStatsCollector
+from pylib.perf.surface_stats_collector import SurfaceStatsCollector
+
class TestSurfaceStatsCollector(unittest.TestCase):
@staticmethod
diff --git a/build/android/pylib/perf/test_runner.py b/build/android/pylib/perf/test_runner.py
index 65ea261..10164a14 100644
--- a/build/android/pylib/perf/test_runner.py
+++ b/build/android/pylib/perf/test_runner.py
@@ -247,7 +247,7 @@ class TestRunner(base_test_runner.BaseTestRunner):
Returns:
A tuple of (TestRunResults, retry).
"""
- output, result_type = self._LaunchPerfTest(test_name)
+ _, result_type = self._LaunchPerfTest(test_name)
results = base_test_result.TestRunResults()
results.AddResult(base_test_result.BaseTestResult(test_name, result_type))
retry = None
diff --git a/build/android/pylib/perf/thermal_throttle.py b/build/android/pylib/perf/thermal_throttle.py
index 6a47319..5828112 100644
--- a/build/android/pylib/perf/thermal_throttle.py
+++ b/build/android/pylib/perf/thermal_throttle.py
@@ -17,13 +17,16 @@ class OmapThrottlingDetector(object):
def __init__(self, adb):
self._adb = adb
- def BecameThrottled(self, log_line):
+ @staticmethod
+ def BecameThrottled(log_line):
return 'omap_thermal_throttle' in log_line
- def BecameUnthrottled(self, log_line):
+ @staticmethod
+ def BecameUnthrottled(log_line):
return 'omap_thermal_unthrottle' in log_line
- def GetThrottlingTemperature(self, log_line):
+ @staticmethod
+ def GetThrottlingTemperature(log_line):
if 'throttle_delayed_work_fn' in log_line:
return float([s for s in log_line.split() if s.isdigit()][0]) / 1000.0
@@ -41,16 +44,20 @@ class ExynosThrottlingDetector(object):
def __init__(self, adb):
pass
- def BecameThrottled(self, log_line):
+ @staticmethod
+ def BecameThrottled(log_line):
return 'exynos_tmu: Throttling interrupt' in log_line
- def BecameUnthrottled(self, log_line):
+ @staticmethod
+ def BecameUnthrottled(log_line):
return 'exynos_thermal_unthrottle: not throttling' in log_line
- def GetThrottlingTemperature(self, log_line):
+ @staticmethod
+ def GetThrottlingTemperature(_log_line):
return None
- def GetCurrentTemperature(self):
+ @staticmethod
+ def GetCurrentTemperature():
return None