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

Side by Side Diff: tracing/tracing/value/diagnostics/add_related_names.html

Issue 3009553002: Refactor Histogram relationship diagnostics. (Closed)
Patch Set: Created 3 years, 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <!--
3 Copyright 2017 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
6 -->
7
8 <link rel="import" href="/tracing/value/diagnostics/reserved_names.html">
9
10 <script>
11 'use strict';
12
13 tr.exportTo('tr.v.d', function() {
14 /**
15 * Add related names GenericSet diagnostic.
16 *
17 * @param {!tr.v.HistogramSet} histograms
18 */
19 function addRelatedNames(histograms) {
20 for (const hist of histograms) {
21 const relatedNames = new Set();
22 for (const [name, diagnostic] of hist.diagnostics) {
23 if (diagnostic instanceof tr.v.d.RelatedHistogramMap) {
24 for (const [relationshipName, relatedHist] of diagnostic) {
25 relatedNames.add(relatedHist.name);
26 }
27 }
28 }
29 if (relatedNames.size) {
30 hist.diagnostics.set(
31 tr.v.d.RESERVED_NAMES.RELATED_NAMES,
32 new tr.v.d.GenericSet(relatedNames));
33 }
34 }
35 }
36
37 return {
38 addRelatedNames,
39 };
40 });
41 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/ui/side_panel/metrics_side_panel.html ('k') | tracing/tracing/value/diagnostics/add_related_names_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698