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

Unified Diff: telemetry/telemetry/value/common_value_helpers.py

Issue 1964663003: [telemetry] Add Html2OutputFormatter for generating results2.html (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: Infinity/NaN in scalar.py -- this is why there should be only one implementation of Values Created 4 years, 7 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
Index: telemetry/telemetry/value/common_value_helpers.py
diff --git a/telemetry/telemetry/value/common_value_helpers.py b/telemetry/telemetry/value/common_value_helpers.py
index 72f4bc9922ab130952b355f9d579b018276e4bc8..9169acfd9209b680c6702037aa512bc101b09d2b 100644
--- a/telemetry/telemetry/value/common_value_helpers.py
+++ b/telemetry/telemetry/value/common_value_helpers.py
@@ -1,6 +1,8 @@
# Copyright 2016 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.
+
+import copy
from telemetry.value import failure
from telemetry.value import improvement_direction
from telemetry.value import scalar
@@ -13,6 +15,10 @@ def TranslateMreFailure(mre_failure, page):
def TranslateScalarValue(scalar_value, page):
assert IsScalarNumericValue(scalar_value)
+ # This function should not modify scalar_value because it is also held by
+ # PageTestResults.value_set.
+ scalar_value = copy.deepcopy(scalar_value)
+
value = scalar_value['numeric']['value']
scalar_value['value'] = value
if value is None:

Powered by Google App Engine
This is Rietveld 408576698