Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1377)

Unified Diff: build/android/pylib/android_commands.py

Issue 26402002: [Android] Some clean up in pylib. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove shebang lines Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/device_stats_monitor.py ('k') | build/android/pylib/device_stats_monitor.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/android_commands.py
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index 28fc8ce0317ead33e98745ee0eb745d0cf9be675..20684b7b07b317b870370d8476eb237f6cbffe23 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -20,7 +20,6 @@ import time
import cmd_helper
import constants
-import io_stats_parser
try:
from pylib import pexpect
except:
@@ -1368,8 +1367,25 @@ class AndroidCommands(object):
Dict of {num_reads, num_writes, read_ms, write_ms} or None if there
was an error.
"""
+ IoStats = collections.namedtuple(
+ 'IoStats',
+ ['device',
+ 'num_reads_issued',
+ 'num_reads_merged',
+ 'num_sectors_read',
+ 'ms_spent_reading',
+ 'num_writes_completed',
+ 'num_writes_merged',
+ 'num_sectors_written',
+ 'ms_spent_writing',
+ 'num_ios_in_progress',
+ 'ms_spent_doing_io',
+ 'ms_spent_doing_io_weighted',
+ ])
+
for line in self.GetFileContents('/proc/diskstats', log_result=False):
- stats = io_stats_parser.ParseIoStatsLine(line)
+ fields = line.split()
+ stats = IoStats._make([fields[2]] + [int(f) for f in fields[3:]])
if stats.device == 'mmcblk0':
return {
'num_reads': stats.num_reads_issued,
« no previous file with comments | « build/android/device_stats_monitor.py ('k') | build/android/pylib/device_stats_monitor.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698