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

Unified Diff: dashboard/dashboard/add_histograms_queue.py

Issue 2990293002: Revision Info into GenericSet (Closed)
Patch Set: Rebase on master Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dashboard/dashboard/add_histograms.py ('k') | dashboard/dashboard/add_histograms_queue_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/add_histograms_queue.py
diff --git a/dashboard/dashboard/add_histograms_queue.py b/dashboard/dashboard/add_histograms_queue.py
index 00bf2cc7cb05ebf5769baa86dfb79c788726123e..94329d5573ef2c8d02798c7a9df659cc3c74c0e0 100644
--- a/dashboard/dashboard/add_histograms_queue.py
+++ b/dashboard/dashboard/add_histograms_queue.py
@@ -22,18 +22,18 @@ from dashboard.models import histogram
from tracing.value import histogram as histogram_module
from tracing.value import histogram_set
from tracing.value.diagnostics import diagnostic_ref
+from tracing.value.diagnostics import reserved_infos
-
-REVISION_FIELDS_TO_ANNOTATION_NAMES = {
- 'chromium_commit_position': 'r_chromium_commit_pos',
- 'v8_commit_position': 'r_v8_rev',
- 'chromium': 'r_chromium_git',
- 'v8': 'r_v8_git',
+DIAGNOSTIC_NAMES_TO_ANNOTATION_NAMES = {
+ reserved_infos.CHROMIUM_COMMIT_POSITIONS.name: 'r_chromium_commit_pos',
+ reserved_infos.V8_COMMIT_POSITIONS.name: 'r_v8_rev',
+ reserved_infos.CHROMIUM_REVISIONS.name: 'r_chromium_git',
+ reserved_infos.V8_REVISIONS.name: 'r_v8_git',
# TODO(eakuefner): Add r_catapult_git to Dashboard revision_info map (see
# https://github.com/catapult-project/catapult/issues/3545).
- 'catapult': 'r_catapult_git',
- 'angle': 'r_angle_git',
- 'webrtc': 'r_webrtc_git'
+ reserved_infos.CATAPULT_REVISIONS.name: 'r_catapult_git',
+ reserved_infos.ANGLE_REVISIONS.name: 'r_angle_git',
+ reserved_infos.WEBRTC_REVISIONS.name: 'r_webrtc_git'
}
@@ -170,16 +170,16 @@ def _MakeRowDict(revision, test_path, tracing_histogram):
d['revision'] = revision
d['supplemental_columns'] = {}
- revision_info = tracing_histogram.diagnostics['revisions']
- for attribute, annotation in REVISION_FIELDS_TO_ANNOTATION_NAMES.iteritems():
- value = getattr(revision_info, attribute)
+ for diag_name, annotation in DIAGNOSTIC_NAMES_TO_ANNOTATION_NAMES.iteritems():
+ revision_info = tracing_histogram.diagnostics.get(diag_name)
+ value = list(revision_info) if revision_info else None
# TODO(eakuefner): Formalize unique-per-upload diagnostics to make this
# check an earlier error. RevisionInfo's fields have to be lists, but there
# should be only one revision of each type per upload.
if not value:
continue
_CheckRequest(
- isinstance(value, list) and len(value) == 1,
+ len(value) == 1,
'RevisionInfo fields must contain at most one revision')
d['supplemental_columns'][annotation] = value[0]
« no previous file with comments | « dashboard/dashboard/add_histograms.py ('k') | dashboard/dashboard/add_histograms_queue_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698