# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+
+from telemetry.value import failure
+from telemetry.value import skip
+
+
def MergeLikeValuesFromSamePage(all_values):
"""Merges values that measure the same thing on the same page.
merge_groups = {}
merge_groups_in_creation_order = []
for value in all_values:
+ # TODO(chrishenry): This is temporary. When we figure out the
+ # right summarization strategy for page runs with failures/skips, we
+ # should use that instead.
+ should_skip_value = (isinstance(value, failure.FailureValue) or
+ isinstance(value, skip.SkipValue))
+
+ if should_skip_value:
+ continue
+
key = key_func(value)
if key not in merge_groups:
merge_groups[key] = []