OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 2016 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <link rel="import" href="/tracing/base/iteration_helpers.html"> | 8 <link rel="import" href="/tracing/base/iteration_helpers.html"> |
9 <link rel="import" href="/tracing/value/diagnostics/diagnostic.html"> | 9 <link rel="import" href="/tracing/value/diagnostics/diagnostic.html"> |
10 <link rel="import" href="/tracing/value/diagnostics/histogram_ref.html"> | 10 <link rel="import" href="/tracing/value/diagnostics/histogram_ref.html"> |
(...skipping 24 matching lines...) Expand all Loading... |
35 |otherParentHist| was merged to |parentHist|. | 35 |otherParentHist| was merged to |parentHist|. |
36 |otherDiagnostic| contains Histograms that are related to | 36 |otherDiagnostic| contains Histograms that are related to |
37 |otherParentHist|. | 37 |otherParentHist|. |
38 | 38 |
39 Since mergeRelationships() is called after all Histograms are merged, | 39 Since mergeRelationships() is called after all Histograms are merged, |
40 then the MERGED_TO diagnostics of the Histograms in |otherDiagnostic| | 40 then the MERGED_TO diagnostics of the Histograms in |otherDiagnostic| |
41 contain Histograms that should be related to |parentHist| via |this| | 41 contain Histograms that should be related to |parentHist| via |this| |
42 RelatedHistogramMap. | 42 RelatedHistogramMap. |
43 | 43 |
44 otherParentHist -----------------------------> parentHist | 44 otherParentHist -----------------------------> parentHist |
45 | merged to RelatedHistogramSet | | 45 | merged to RelatedHistogramMap | |
46 | | | 46 | | |
47 | otherDiagnostic | this | 47 | otherDiagnostic | this |
48 | RelatedHistogramMap | RelatedHistogramMap | 48 | RelatedHistogramMap | RelatedHistogramMap |
49 v v | 49 v v |
50 otherRelatedHist -----------------------------> relatedHist | 50 otherRelatedHist -----------------------------> relatedHist |
51 merged to RelatedHistogramSet | 51 merged to RelatedHistogramMap |
52 | 52 |
53 However, |otherRelatedHist| may have been merged to Histograms using | 53 However, |otherRelatedHist| may have been merged to Histograms using |
54 different grouping keys, so if |relatedHist|'s merge path is different | 54 different grouping keys, so if |relatedHist|'s merge path is different |
55 from |parentHist|'s merge path, then |relatedHist| should not be related | 55 from |parentHist|'s merge path, then |relatedHist| should not be related |
56 to |parentHist|. | 56 to |parentHist|. |
57 */ | 57 */ |
58 | 58 |
59 const parentGroupingPath = tr.v.d.GroupingPath.getFromHistogram( | 59 const parentGroupingPath = tr.v.d.GroupingPath.getFromHistogram( |
60 parentHist); | 60 parentHist); |
61 | 61 |
62 for (const [name, otherRelatedHist] of otherDiagnostic) { | 62 for (const [name, otherRelatedHist] of otherDiagnostic) { |
63 const mergedTo = otherRelatedHist.diagnostics.get( | 63 const mergedTo = otherRelatedHist.diagnostics.get( |
64 tr.v.d.RESERVED_NAMES.MERGED_TO); | 64 tr.v.d.RESERVED_NAMES.MERGED_TO); |
65 if (mergedTo === undefined) continue; | 65 if (mergedTo === undefined) continue; |
66 | 66 |
67 for (const relatedHist of mergedTo) { | 67 for (const relatedHist of mergedTo.histogramsByName_.values()) { |
68 const relatedGroupingPath = tr.v.d.GroupingPath.getFromHistogram( | 68 const relatedGroupingPath = tr.v.d.GroupingPath.getFromHistogram( |
69 relatedHist); | 69 relatedHist); |
70 if (relatedGroupingPath === undefined) continue; | 70 if (relatedGroupingPath === undefined) continue; |
71 if (!parentGroupingPath.equals(relatedGroupingPath)) continue; | 71 if (!parentGroupingPath.equals(relatedGroupingPath)) continue; |
72 | 72 |
73 this.set(name, relatedHist); | 73 this.set(name, relatedHist); |
74 } | 74 } |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 tr.v.d.Diagnostic.register(RelatedHistogramMap, { | 164 tr.v.d.Diagnostic.register(RelatedHistogramMap, { |
165 elementName: 'tr-v-ui-related-histogram-map-span' | 165 elementName: 'tr-v-ui-related-histogram-map-span' |
166 }); | 166 }); |
167 | 167 |
168 return { | 168 return { |
169 RelatedHistogramMap, | 169 RelatedHistogramMap, |
170 }; | 170 }; |
171 }); | 171 }); |
172 </script> | 172 </script> |
OLD | NEW |