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

Side by Side Diff: runtime/observatory/lib/src/elements/isolate_view.dart

Issue 2600533002: Added entry for thread information in the isolate view of the observatory. Current information show… (Closed)
Patch Set: Created 3 years, 12 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 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library isolate_view_element; 5 library isolate_view_element;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:html'; 8 import 'dart:html';
9 import 'package:observatory/models.dart' as M; 9 import 'package:observatory/models.dart' as M;
10 import 'package:observatory/src/elements/curly_block.dart'; 10 import 'package:observatory/src/elements/curly_block.dart';
11 import 'package:observatory/src/elements/eval_box.dart'; 11 import 'package:observatory/src/elements/eval_box.dart';
12 import 'package:observatory/src/elements/function_ref.dart'; 12 import 'package:observatory/src/elements/function_ref.dart';
13 import 'package:observatory/src/elements/helpers/nav_bar.dart'; 13 import 'package:observatory/src/elements/helpers/nav_bar.dart';
14 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; 14 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart';
15 import 'package:observatory/src/elements/helpers/tag.dart'; 15 import 'package:observatory/src/elements/helpers/tag.dart';
16 import 'package:observatory/src/elements/helpers/uris.dart'; 16 import 'package:observatory/src/elements/helpers/uris.dart';
17 import 'package:observatory/src/elements/isolate/location.dart'; 17 import 'package:observatory/src/elements/isolate/location.dart';
18 import 'package:observatory/src/elements/isolate/run_state.dart'; 18 import 'package:observatory/src/elements/isolate/run_state.dart';
19 import 'package:observatory/src/elements/isolate/shared_summary.dart'; 19 import 'package:observatory/src/elements/isolate/shared_summary.dart';
20 import 'package:observatory/src/elements/library_ref.dart'; 20 import 'package:observatory/src/elements/library_ref.dart';
21 import 'package:observatory/src/elements/nav/class_menu.dart'; 21 import 'package:observatory/src/elements/nav/class_menu.dart';
22 import 'package:observatory/src/elements/nav/isolate_menu.dart'; 22 import 'package:observatory/src/elements/nav/isolate_menu.dart';
23 import 'package:observatory/src/elements/nav/notify.dart'; 23 import 'package:observatory/src/elements/nav/notify.dart';
24 import 'package:observatory/src/elements/nav/refresh.dart'; 24 import 'package:observatory/src/elements/nav/refresh.dart';
25 import 'package:observatory/src/elements/nav/top_menu.dart'; 25 import 'package:observatory/src/elements/nav/top_menu.dart';
26 import 'package:observatory/src/elements/nav/vm_menu.dart'; 26 import 'package:observatory/src/elements/nav/vm_menu.dart';
27 import 'package:observatory/src/elements/script_inset.dart'; 27 import 'package:observatory/src/elements/script_inset.dart';
28 import 'package:observatory/src/elements/source_inset.dart'; 28 import 'package:observatory/src/elements/source_inset.dart';
29 import 'package:observatory/src/elements/view_footer.dart'; 29 import 'package:observatory/src/elements/view_footer.dart';
30 import 'package:observatory/utils.dart';
30 31
31 class IsolateViewElement extends HtmlElement implements Renderable { 32 class IsolateViewElement extends HtmlElement implements Renderable {
32 static const tag = 33 static const tag =
33 const Tag<IsolateViewElement>('isolate-view', dependencies: const [ 34 const Tag<IsolateViewElement>('isolate-view', dependencies: const [
34 CurlyBlockElement.tag, 35 CurlyBlockElement.tag,
35 EvalBoxElement.tag, 36 EvalBoxElement.tag,
36 FunctionRefElement.tag, 37 FunctionRefElement.tag,
37 IsolateLocationElement.tag, 38 IsolateLocationElement.tag,
38 IsolateRunStateElement.tag, 39 IsolateRunStateElement.tag,
39 IsolateSharedSummaryElement.tag, 40 IsolateSharedSummaryElement.tag,
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 detached() { 127 detached() {
127 super.detached(); 128 super.detached();
128 _r.disable(notify: true); 129 _r.disable(notify: true);
129 children = []; 130 children = [];
130 _subscription.cancel(); 131 _subscription.cancel();
131 } 132 }
132 133
133 void render() { 134 void render() {
134 final uptime = new DateTime.now().difference(_isolate.startTime); 135 final uptime = new DateTime.now().difference(_isolate.startTime);
135 final libraries = _isolate.libraries.toList(); 136 final libraries = _isolate.libraries.toList();
137 final List<Thread> threads = _isolate.threads;
136 children = [ 138 children = [
137 navBar([ 139 navBar([
138 new NavTopMenuElement(queue: _r.queue), 140 new NavTopMenuElement(queue: _r.queue),
139 new NavVMMenuElement(_vm, _events, queue: _r.queue), 141 new NavVMMenuElement(_vm, _events, queue: _r.queue),
140 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue), 142 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue),
141 new NavRefreshElement(label: 'Reload Source', queue: _r.queue) 143 new NavRefreshElement(label: 'Reload Source', queue: _r.queue)
142 ..onRefresh.listen((e) async { 144 ..onRefresh.listen((e) async {
143 e.element.disabled = true; 145 e.element.disabled = true;
144 await _isolates.reloadSources(_isolate); 146 await _isolates.reloadSources(_isolate);
145 _r.dirty(); 147 _r.dirty();
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 ..children = [ 289 ..children = [
288 new CurlyBlockElement(queue: _r.queue) 290 new CurlyBlockElement(queue: _r.queue)
289 ..content = libraries 291 ..content = libraries
290 .map((l) => new DivElement() 292 .map((l) => new DivElement()
291 ..children = [ 293 ..children = [
292 new LibraryRefElement(_isolate, l, 294 new LibraryRefElement(_isolate, l,
293 queue: _r.queue) 295 queue: _r.queue)
294 ]) 296 ])
295 .toList() 297 .toList()
296 ] 298 ]
299 ],
300 new DivElement()
301 ..classes = ['memberItem']
302 ..children = [
303 new DivElement()
304 ..classes = ['memberName']
305 ..text = 'threads (${threads.length})',
306 new DivElement()
307 ..classes = ['memberValue']
308 ..children = [
309 new CurlyBlockElement(queue: _r.queue)
310 ..content = threads
311 .map(_populateThreadInfo)
312 ]
297 ] 313 ]
298 ], 314 ],
299 new HRElement(), 315 new HRElement(),
300 new EvalBoxElement(_isolate, _isolate.rootLibrary, _instances, _eval, 316 new EvalBoxElement(_isolate, _isolate.rootLibrary, _instances, _eval,
301 queue: _r.queue), 317 queue: _r.queue),
302 new DivElement() 318 new DivElement()
303 ..children = _rootScript != null 319 ..children = _rootScript != null
304 ? [ 320 ? [
305 new HRElement(), 321 new HRElement(),
306 new ScriptInsetElement( 322 new ScriptInsetElement(
307 _isolate, _rootScript, _scripts, _instances, _events, 323 _isolate, _rootScript, _scripts, _instances, _events,
308 queue: _r.queue) 324 queue: _r.queue)
309 ] 325 ]
310 : const [], 326 : const [],
311 new HRElement(), 327 new HRElement(),
312 new ViewFooterElement(queue: _r.queue) 328 new ViewFooterElement(queue: _r.queue)
313 ] 329 ]
314 ]; 330 ];
315 } 331 }
316 332
333 DivElement _populateThreadInfo(Thread t) {
334 int index = 0;
335 return new DivElement()
336 ..classes = ['indent']
337 ..children = [
338 new SpanElement()
339 ..text = '${t.id} ',
340 new CurlyBlockElement(queue: _r.queue)
341 ..content = [
342 new DivElement()
343 ..classes = ['indent']
344 ..text = 'kind ${t.kindString}',
345 new DivElement()
346 ..children = t.zones
347 .map((z) => new DivElement()
348 ..classes = ['indent']
349 ..children = [
350 new DivElement()
351 ..children = [
352 new SpanElement()
353 ..children = [
354 new SpanElement()
355 ..text = 'zone ${index++} ',
356 new CurlyBlockElement(queue: _r.queue)
357 ..content = [
358 new DivElement()
359 ..classes = ['memberList']
360 ..children = [
361 new DivElement()
362 ..classes = ['memberItem']
363 ..children = [
364 new SpanElement()
365 ..classes = ['memberName']
366 ..text = 'used ',
367 new SpanElement()
368 ..classes = ['memberValue']
369 ..title = '${z.used}B'
370 ..text =
371 Utils.formatSize(z.used)
372 ],
373 new DivElement()
374 ..classes = ['memberItem']
375 ..children = [
376 new SpanElement()
377 ..classes = ['memberName']
378 ..text = 'capacity',
379 new SpanElement()
380 ..classes = ['memberValue']
381 ..title = '${z.capacity}B'
382 ..text =
383 Utils.formatSize(z.capacity)
384 ]
385 ]
386 ]
387 ]
388 ]
389 ]
390 )]
391 ];
392 }
393
317 Future _loadExtraData() async { 394 Future _loadExtraData() async {
318 _function = null; 395 _function = null;
319 _rootScript = null; 396 _rootScript = null;
320 final frame = M.topFrame(_isolate.pauseEvent); 397 final frame = M.topFrame(_isolate.pauseEvent);
321 if (frame != null) { 398 if (frame != null) {
322 _function = await _functions.get(_isolate, frame.function.id); 399 _function = await _functions.get(_isolate, frame.function.id);
323 } 400 }
324 if (_isolate.rootLibrary != null) { 401 if (_isolate.rootLibrary != null) {
325 final rootLibrary = 402 final rootLibrary =
326 await _libraries.get(_isolate, _isolate.rootLibrary.id); 403 await _libraries.get(_isolate, _isolate.rootLibrary.id);
327 _rootScript = rootLibrary.rootScript; 404 _rootScript = rootLibrary.rootScript;
328 } 405 }
329 _r.dirty(); 406 _r.dirty();
330 } 407 }
331 } 408 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698