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

Side by Side Diff: build/android/pylib/instrumentation/json_perf_parser.py

Issue 1315743004: [Android] Add a custom pylintrc for build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix appurify_sanitized import-errors Created 5 years, 3 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
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 5
6 """A helper module for parsing JSON objects from perf tests results.""" 6 """A helper module for parsing JSON objects from perf tests results."""
7 7
8 import json 8 import json
9 9
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 name: The passed in name filter. 58 name: The passed in name filter.
59 data_points: A list of all of the times used to generate this data. 59 data_points: A list of all of the times used to generate this data.
60 units: The units for the values being reported. 60 units: The units for the values being reported.
61 61
62 Raises: 62 Raises:
63 Exception: if entry contains invalid data. 63 Exception: if entry contains invalid data.
64 """ 64 """
65 65
66 def EntryFilter(entry): 66 def EntryFilter(entry):
67 return entry['cat'] == 'Java' and entry['name'] == name 67 return entry['cat'] == 'Java' and entry['name'] == name
68 filtered_entries = filter(EntryFilter, json_data) 68 filtered_entries = [j for j in json_data if EntryFilter(j)]
69 69
70 result = {} 70 result = {}
71 71
72 result['min'] = -1 72 result['min'] = -1
73 result['max'] = -1 73 result['max'] = -1
74 result['average'] = 0 74 result['average'] = 0
75 result['count'] = 0 75 result['count'] = 0
76 result['type'] = 'Unknown' 76 result['type'] = 'Unknown'
77 result['category'] = 'Java' 77 result['category'] = 'Java'
78 result['name'] = name 78 result['name'] = name
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 name: The 'name' tag to filter on in the JSON file. 152 name: The 'name' tag to filter on in the JSON file.
153 153
154 Returns: 154 Returns:
155 See GetAverageRunInfo Returns section. 155 See GetAverageRunInfo Returns section.
156 """ 156 """
157 with open(json_file, 'r') as f: 157 with open(json_file, 'r') as f:
158 data = f.read() 158 data = f.read()
159 perf = json.loads(data) 159 perf = json.loads(data)
160 160
161 return GetAverageRunInfo(perf, name) 161 return GetAverageRunInfo(perf, name)
OLDNEW
« no previous file with comments | « build/android/pylib/instrumentation/instrumentation_test_instance.py ('k') | build/android/pylib/instrumentation/test_jar.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698