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

Side by Side Diff: dashboard/dashboard/static/memory_related_names.html

Issue 2993773002: Dashboard charts: display sparklines of related timeseries in a tab strip. (Closed)
Patch Set: fix warnings[].value 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright 2017 The Chromium Authors. All rights reserved. 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 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/base.html"> 8 <link rel="import" href="/tracing/base/base.html">
9 9
10 <script> 10 <script>
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 MEMORY_NAMES.add(`memory:${browser}:${process}:reported_by_chrome:v8:$ {v8Component}:${value}_avg`); 95 MEMORY_NAMES.add(`memory:${browser}:${process}:reported_by_chrome:v8:$ {v8Component}:${value}_avg`);
96 for (const sub of V8_SUBCOMPONENTS) { 96 for (const sub of V8_SUBCOMPONENTS) {
97 MEMORY_NAMES.add(`memory:${browser}:${process}:reported_by_chrome:v8 :${v8Component}:${sub}:${value}_avg`); 97 MEMORY_NAMES.add(`memory:${browser}:${process}:reported_by_chrome:v8 :${v8Component}:${sub}:${value}_avg`);
98 } 98 }
99 } 99 }
100 } 100 }
101 } 101 }
102 } 102 }
103 /* eslint-enable max-len */ 103 /* eslint-enable max-len */
104 104
105 const MEMORY_RELATED_NAMES = new Map(); 105 const MEMORY_PROCESS_RELATED_NAMES = new Map();
106 const MEMORY_COMPONENT_RELATED_NAMES = new Map();
106 107
107 const ALL_PROCESSES = 'all_processes'; 108 const ALL_PROCESSES = 'all_processes';
108 const REPORTED_BY_CHROME = 'reported_by_chrome'; 109 const REPORTED_BY_CHROME = 'reported_by_chrome';
109 110
110 for (const name of MEMORY_NAMES) { 111 for (const name of MEMORY_NAMES) {
111 let relatedNames = MEMORY_RELATED_NAMES.get(name); 112 let processRelatedNames = MEMORY_PROCESS_RELATED_NAMES.get(name);
112 if (relatedNames === undefined) { 113 if (processRelatedNames === undefined) {
113 relatedNames = new Set(); 114 processRelatedNames = new Set();
114 MEMORY_RELATED_NAMES.set(name, relatedNames); 115 MEMORY_PROCESS_RELATED_NAMES.set(name, processRelatedNames);
115 } 116 }
116 117
117 // Each 'all_processes' name is related to all ${process} variants of that 118 // Each 'all_processes' name is related to all ${process} variants of that
118 // name. 119 // name.
119 120
120 const index = name.indexOf(ALL_PROCESSES); 121 const index = name.indexOf(ALL_PROCESSES);
121 if (index !== -1) { 122 if (index !== -1) {
122 const suffix = name.slice(index + ALL_PROCESSES.length); 123 const suffix = name.slice(index + ALL_PROCESSES.length);
123 for (const other of MEMORY_NAMES) { 124 for (const other of MEMORY_NAMES) {
124 if (other.includes(suffix)) { 125 if (other.includes(suffix)) {
125 relatedNames.add(other); 126 processRelatedNames.add(other);
126 } 127 }
127 } 128 }
128 } 129 }
129 130
130 // Each component=[] name is related to all component!=[] variants of that 131 // Each component=[] name is related to all component!=[] variants of that
131 // name. 132 // name.
132 const parts = name.split(':'); 133 const parts = name.split(':');
133 for (let end = 4; end < parts.length - 1; ++end) { 134 for (let end = 4; end < parts.length - 1; ++end) {
134 const prefix = parts.slice(0, end).join(':'); 135 const prefix = parts.slice(0, end).join(':');
135 const suffix = parts[parts.length - 1]; 136 const suffix = parts[parts.length - 1];
136 const sansComponent = `${prefix}:${suffix}`; 137 const sansComponent = `${prefix}:${suffix}`;
137 if (!MEMORY_RELATED_NAMES.has(sansComponent)) { 138 if (!MEMORY_COMPONENT_RELATED_NAMES.has(sansComponent)) {
138 MEMORY_RELATED_NAMES.set(sansComponent, new Set()); 139 MEMORY_COMPONENT_RELATED_NAMES.set(sansComponent, new Set());
139 } 140 }
140 MEMORY_RELATED_NAMES.get(sansComponent).add(name); 141 MEMORY_COMPONENT_RELATED_NAMES.get(sansComponent).add(name);
141 } 142 }
142 } 143 }
143 144
144 return { 145 return {
145 MEMORY_RELATED_NAMES, 146 MEMORY_PROCESS_RELATED_NAMES,
147 MEMORY_COMPONENT_RELATED_NAMES,
146 }; 148 };
147 }); 149 });
148 </script> 150 </script>
OLDNEW
« no previous file with comments | « dashboard/dashboard/static/group_alerts.html ('k') | dashboard/dashboard/static/related_timeseries.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698