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

Side by Side Diff: build/android/pylib/io_stats_parser.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/android/pylib/fake_dns.py ('k') | build/android/pylib/surface_stats_collector.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """Provides an interface to communicate with the device via the adb command.
6
7 Assumes adb binary is currently on system path.
8 """
9
10
11 import collections
12
13
14 def ParseIoStatsLine(line):
15 """Parses a line of io stats into a IoStats named tuple."""
16 # Field definitions: http://www.kernel.org/doc/Documentation/iostats.txt
17 IoStats = collections.namedtuple('IoStats',
18 ['device',
19 'num_reads_issued',
20 'num_reads_merged',
21 'num_sectors_read',
22 'ms_spent_reading',
23 'num_writes_completed',
24 'num_writes_merged',
25 'num_sectors_written',
26 'ms_spent_writing',
27 'num_ios_in_progress',
28 'ms_spent_doing_io',
29 'ms_spent_doing_io_weighted',
30 ])
31 fields = line.split()
32 return IoStats._make([fields[2]] + [int(f) for f in fields[3:]])
OLDNEW
« no previous file with comments | « build/android/pylib/fake_dns.py ('k') | build/android/pylib/surface_stats_collector.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698