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

Side by Side Diff: tools/telemetry/telemetry/value/merge_values.py

Issue 445793004: Fix import order with isort tool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 4 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 from telemetry.value import failure 5 from telemetry.value import failure
6 from telemetry.value import skip 6 from telemetry.value import skip
7 7
8
8 def MergeLikeValuesFromSamePage(all_values): 9 def MergeLikeValuesFromSamePage(all_values):
9 """Merges values that measure the same thing on the same page. 10 """Merges values that measure the same thing on the same page.
10 11
11 A page may end up being measured multiple times, meaning that we may end up 12 A page may end up being measured multiple times, meaning that we may end up
12 with something like this: 13 with something like this:
13 ScalarValue(page1, 'x', 1) 14 ScalarValue(page1, 'x', 1)
14 ScalarValue(page2, 'x', 4) 15 ScalarValue(page2, 'x', 4)
15 ScalarValue(page1, 'x', 2) 16 ScalarValue(page1, 'x', 2)
16 ScalarValue(page2, 'x', 5) 17 ScalarValue(page2, 'x', 5)
17 18
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 121
121 if should_skip_value: 122 if should_skip_value:
122 continue 123 continue
123 124
124 key = key_func(value) 125 key = key_func(value)
125 if key not in merge_groups: 126 if key not in merge_groups:
126 merge_groups[key] = [] 127 merge_groups[key] = []
127 merge_groups_in_creation_order.append(merge_groups[key]) 128 merge_groups_in_creation_order.append(merge_groups[key])
128 merge_groups[key].append(value) 129 merge_groups[key].append(value)
129 return merge_groups_in_creation_order 130 return merge_groups_in_creation_order
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698