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

Unified Diff: tools/telemetry/telemetry/value/value_backcompat.py

Issue 402663002: Remove results.Add and value_backcompat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
« no previous file with comments | « tools/telemetry/telemetry/results/page_measurement_results.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/value/value_backcompat.py
diff --git a/tools/telemetry/telemetry/value/value_backcompat.py b/tools/telemetry/telemetry/value/value_backcompat.py
deleted file mode 100644
index 6d970de7781ea3a258ed4a63914d252d62fd9b43..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/value/value_backcompat.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# 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.
-"""Backward compatibility for old results API.
-
-This module helps convert the old PageMeasurementResults API into the new
-style one. This exists as a bridging solution so we can change the underlying
-implementation and update the PageMeasurementResults API once we know the
-underlying implementation is solid.
-"""
-from telemetry import value as value_module
-from telemetry.value import histogram
-from telemetry.value import list_of_scalar_values
-from telemetry.value import scalar
-
-
-def ConvertOldCallingConventionToValue(page, trace_name, units,
- value, chart_name, data_type):
- value_name = value_module.ValueNameFromTraceAndChartName(
- trace_name, chart_name)
- if data_type == 'default':
- if isinstance(value, list):
- return list_of_scalar_values.ListOfScalarValues(
- page, value_name, units, value, important=True)
- else:
- return scalar.ScalarValue(page, value_name, units,
- value, important=True)
- elif data_type == 'unimportant':
- if isinstance(value, list):
- return list_of_scalar_values.ListOfScalarValues(
- page, value_name, units, value, important=False)
- else:
- return scalar.ScalarValue(page, value_name, units,
- value, important=False)
- elif data_type == 'histogram':
- assert isinstance(value, basestring)
- return histogram.HistogramValue(
- page, value_name, units, raw_value_json=value, important=True)
- elif data_type == 'unimportant-histogram':
- assert isinstance(value, basestring)
- return histogram.HistogramValue(
- page, value_name, units, raw_value_json=value, important=False)
- elif data_type == 'informational':
- raise NotImplementedError()
- else:
- raise ValueError('Unrecognized data type %s', data_type)
« no previous file with comments | « tools/telemetry/telemetry/results/page_measurement_results.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698