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

Unified Diff: dashboard/dashboard/add_histograms.py

Issue 2989143002: Plumb SparseDiagnostics by Name (Closed)
Patch Set: Rebase onto 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 | « no previous file | dashboard/dashboard/add_histograms_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dashboard/dashboard/add_histograms.py
diff --git a/dashboard/dashboard/add_histograms.py b/dashboard/dashboard/add_histograms.py
index 27792e7bbb48361dbc96ae27789784f99c39842d..f6c64075649f57affe4ef361bbebd1a5159506e3 100644
--- a/dashboard/dashboard/add_histograms.py
+++ b/dashboard/dashboard/add_histograms.py
@@ -20,9 +20,17 @@ from tracing.value import histogram_set
from tracing.value.diagnostics import diagnostic
from tracing.value.diagnostics import reserved_infos
-# TODO(#3718): Use names along with types to create sparse diagnostics, add here
-# owners and bug components as sparse level diagnostics. Do the same for the
-# diagnostics describing device information.
+SUITE_LEVEL_SPARSE_DIAGNOSTIC_NAMES = set(
+ [reserved_infos.ARCHITECTURES.name,
+ reserved_infos.BUG_COMPONENTS.name,
+ reserved_infos.GPUS.name,
+ reserved_infos.MEMORY_AMOUNTS.name,
+ reserved_infos.OS_NAMES.name,
+ reserved_infos.OS_VERSIONS.name,
+ reserved_infos.OWNERS.name,
+ reserved_infos.PRODUCT_VERSIONS.name])
+# TODO(#3507): Make BuildbotInfo into GenericSet diagnostics and remove all
+# logic regarding picking diagnostics by type.
SUITE_LEVEL_SPARSE_DIAGNOSTIC_TYPES = set(
[histogram_module.BuildbotInfo])
HISTOGRAM_LEVEL_SPARSE_DIAGNOSTIC_TYPES = set(
@@ -68,15 +76,27 @@ def ProcessHistogramSet(histogram_dicts):
suite_key = GetSuiteKey(histograms)
suite_level_sparse_diagnostic_entities = []
- for diag in histograms.shared_diagnostics:
- # We'll skip the histogram-level sparse diagnostics because we need to
- # handle those with the histograms, below, so that we can properly assign
- # test paths.
- if type(diag) in SUITE_LEVEL_SPARSE_DIAGNOSTIC_TYPES:
- suite_level_sparse_diagnostic_entities.append(
- histogram.SparseDiagnostic(
- id=diag.guid, data=diag.AsDict(), test=suite_key,
- start_revision=revision, end_revision=sys.maxint))
+ diagnostic_names_added = {}
+
+ # We'll skip the histogram-level sparse diagnostics because we need to
+ # handle those with the histograms, below, so that we can properly assign
+ # test paths.
+ for hist in histograms:
+ for name, diag in hist.diagnostics.iteritems():
+ if name in SUITE_LEVEL_SPARSE_DIAGNOSTIC_NAMES:
+ if diagnostic_names_added.get(name) is None:
+ diagnostic_names_added[name] = diag.guid
+
+ if diagnostic_names_added.get(name) != diag.guid:
+ raise ValueError(
+ name + ' diagnostics must be the same for all histograms')
+
+ if (name in SUITE_LEVEL_SPARSE_DIAGNOSTIC_NAMES or
+ type(diag) in SUITE_LEVEL_SPARSE_DIAGNOSTIC_TYPES):
+ suite_level_sparse_diagnostic_entities.append(
+ histogram.SparseDiagnostic(
+ id=diag.guid, data=diag.AsDict(), test=suite_key,
+ start_revision=revision, end_revision=sys.maxint, name=name))
# TODO(eakuefner): Refactor master/bot computation to happen above this line
# so that we can replace with a DiagnosticRef rather than a full diagnostic.
@@ -225,6 +245,7 @@ def InlineDenseSharedDiagnostics(histograms):
# TODO(eakuefner): Delete inlined diagnostics from the set
for hist in histograms:
diagnostics = hist.diagnostics
- for diag in diagnostics.itervalues():
- if type(diag) not in SPARSE_DIAGNOSTIC_TYPES:
+ for name, diag in diagnostics.iteritems():
+ if (type(diag) not in SPARSE_DIAGNOSTIC_TYPES and
+ name not in SUITE_LEVEL_SPARSE_DIAGNOSTIC_NAMES):
diag.Inline()
« no previous file with comments | « no previous file | dashboard/dashboard/add_histograms_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698