OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:html'; | 6 import 'dart:html'; |
7 import 'package:charted/charted.dart'; | 7 import 'package:charted/charted.dart'; |
8 import "package:charted/charts/charts.dart"; | 8 import "package:charted/charts/charts.dart"; |
9 import 'package:observatory/models.dart' as M; | 9 import 'package:observatory/models.dart' as M; |
10 import 'package:observatory/src/elements/class_ref.dart'; | 10 import 'package:observatory/src/elements/class_ref.dart'; |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 ..text = '0', | 347 ..text = '0', |
348 new SpanElement() | 348 new SpanElement() |
349 ..classes = ['bytes'] | 349 ..classes = ['bytes'] |
350 ..text = '0B', | 350 ..text = '0B', |
351 new SpanElement() | 351 new SpanElement() |
352 ..classes = ['instances'] | 352 ..classes = ['instances'] |
353 ..text = '0', | 353 ..text = '0', |
354 new SpanElement()..classes = ['name'] | 354 new SpanElement()..classes = ['name'] |
355 ]; | 355 ]; |
356 | 356 |
357 Element _createCollectionHeader() => new DivElement() | 357 List<HtmlElement> _createCollectionHeader() => [ |
358 ..children = [ | 358 new DivElement() |
359 new DivElement() | 359 ..classes = ['collection-item'] |
360 ..classes = ['collection-item'] | 360 ..children = [ |
361 ..children = [ | 361 new SpanElement() |
362 new SpanElement() | 362 ..classes = ['group'] |
363 ..classes = ['group'] | 363 ..text = 'Accumulated', |
364 ..text = 'Accumulated', | 364 new SpanElement() |
365 new SpanElement() | 365 ..classes = ['group'] |
366 ..classes = ['group'] | 366 ..text = 'Current', |
367 ..text = 'Current', | 367 new SpanElement() |
368 new SpanElement() | 368 ..classes = ['group'] |
369 ..classes = ['group'] | 369 ..text = '(NEW) Accumulated', |
370 ..text = '(NEW) Accumulated', | 370 new SpanElement() |
371 new SpanElement() | 371 ..classes = ['group'] |
372 ..classes = ['group'] | 372 ..text = '(NEW) Current', |
373 ..text = '(NEW) Current', | 373 new SpanElement() |
374 new SpanElement() | 374 ..classes = ['group'] |
375 ..classes = ['group'] | 375 ..text = '(OLD) Accumulated', |
376 ..text = '(OLD) Accumulated', | 376 new SpanElement() |
377 new SpanElement() | 377 ..classes = ['group'] |
378 ..classes = ['group'] | 378 ..text = '(OLD) Current', |
379 ..text = '(OLD) Current', | 379 ], |
380 ], | 380 new DivElement() |
381 new DivElement() | 381 ..classes = ['collection-item'] |
382 ..classes = ['collection-item'] | 382 ..children = [ |
383 ..children = [ | 383 _createHeaderButton(const ['bytes'], 'Size', |
384 _createHeaderButton(const ['bytes'], 'Size', | 384 _SortingField.accumulatedSize, _SortingDirection.descending), |
385 _SortingField.accumulatedSize, _SortingDirection.descending), | 385 _createHeaderButton( |
386 _createHeaderButton(const ['instances'], 'Instances', | 386 const ['instances'], |
387 _SortingField.accumulatedInstances, _SortingDirection.descending), | 387 'Instances', |
388 _createHeaderButton(const ['bytes'], 'Size', | 388 _SortingField.accumulatedInstances, |
389 _SortingField.currentSize, _SortingDirection.descending), | 389 _SortingDirection.descending), |
390 _createHeaderButton(const ['instances'], 'Instances', | 390 _createHeaderButton(const ['bytes'], 'Size', |
391 _SortingField.currentInstances, _SortingDirection.descending), | 391 _SortingField.currentSize, _SortingDirection.descending), |
392 _createHeaderButton(const ['bytes'], 'Size', | 392 _createHeaderButton(const ['instances'], 'Instances', |
393 _SortingField.newAccumulatedSize, _SortingDirection.descending), | 393 _SortingField.currentInstances, _SortingDirection.descending), |
394 _createHeaderButton( | 394 _createHeaderButton(const ['bytes'], 'Size', |
395 const ['instances'], | 395 _SortingField.newAccumulatedSize, _SortingDirection.descending), |
396 'Instances', | 396 _createHeaderButton( |
397 _SortingField.newAccumulatedInstances, | 397 const ['instances'], |
398 _SortingDirection.descending), | 398 'Instances', |
399 _createHeaderButton(const ['bytes'], 'Size', | 399 _SortingField.newAccumulatedInstances, |
400 _SortingField.newCurrentSize, _SortingDirection.descending), | 400 _SortingDirection.descending), |
401 _createHeaderButton(const ['instances'], 'Instances', | 401 _createHeaderButton(const ['bytes'], 'Size', |
402 _SortingField.newCurrentInstances, _SortingDirection.descending), | 402 _SortingField.newCurrentSize, _SortingDirection.descending), |
403 _createHeaderButton(const ['bytes'], 'Size', | 403 _createHeaderButton( |
404 _SortingField.oldAccumulatedSize, _SortingDirection.descending), | 404 const ['instances'], |
405 _createHeaderButton( | 405 'Instances', |
406 const ['instances'], | 406 _SortingField.newCurrentInstances, |
407 'Instances', | 407 _SortingDirection.descending), |
408 _SortingField.oldAccumulatedInstances, | 408 _createHeaderButton(const ['bytes'], 'Size', |
409 _SortingDirection.descending), | 409 _SortingField.oldAccumulatedSize, _SortingDirection.descending), |
410 _createHeaderButton(const ['bytes'], 'Size', | 410 _createHeaderButton( |
411 _SortingField.oldCurrentSize, _SortingDirection.descending), | 411 const ['instances'], |
412 _createHeaderButton(const ['instances'], 'Instances', | 412 'Instances', |
413 _SortingField.oldCurrentInstances, _SortingDirection.descending), | 413 _SortingField.oldAccumulatedInstances, |
414 _createHeaderButton(const ['name'], 'Class', _SortingField.className, | 414 _SortingDirection.descending), |
415 _SortingDirection.ascending) | 415 _createHeaderButton(const ['bytes'], 'Size', |
416 ], | 416 _SortingField.oldCurrentSize, _SortingDirection.descending), |
417 ]; | 417 _createHeaderButton( |
| 418 const ['instances'], |
| 419 'Instances', |
| 420 _SortingField.oldCurrentInstances, |
| 421 _SortingDirection.descending), |
| 422 _createHeaderButton(const ['name'], 'Class', |
| 423 _SortingField.className, _SortingDirection.ascending) |
| 424 ], |
| 425 ]; |
418 | 426 |
419 ButtonElement _createHeaderButton(List<String> classes, String text, | 427 ButtonElement _createHeaderButton(List<String> classes, String text, |
420 _SortingField field, _SortingDirection direction) => | 428 _SortingField field, _SortingDirection direction) => |
421 new ButtonElement() | 429 new ButtonElement() |
422 ..classes = classes | 430 ..classes = classes |
423 ..text = _sortingField != field | 431 ..text = _sortingField != field |
424 ? text | 432 ? text |
425 : _sortingDirection == _SortingDirection.ascending | 433 : _sortingDirection == _SortingDirection.ascending |
426 ? '$text▼' | 434 ? '$text▼' |
427 : '$text▲' | 435 : '$text▲' |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 static int _getNewCurrentInstances(M.ClassHeapStats s) => | 648 static int _getNewCurrentInstances(M.ClassHeapStats s) => |
641 s.newSpace.current.instances; | 649 s.newSpace.current.instances; |
642 static int _getOldAccumulatedSize(M.ClassHeapStats s) => | 650 static int _getOldAccumulatedSize(M.ClassHeapStats s) => |
643 s.oldSpace.accumulated.bytes; | 651 s.oldSpace.accumulated.bytes; |
644 static int _getOldAccumulatedInstances(M.ClassHeapStats s) => | 652 static int _getOldAccumulatedInstances(M.ClassHeapStats s) => |
645 s.oldSpace.accumulated.instances; | 653 s.oldSpace.accumulated.instances; |
646 static int _getOldCurrentSize(M.ClassHeapStats s) => s.oldSpace.current.bytes; | 654 static int _getOldCurrentSize(M.ClassHeapStats s) => s.oldSpace.current.bytes; |
647 static int _getOldCurrentInstances(M.ClassHeapStats s) => | 655 static int _getOldCurrentInstances(M.ClassHeapStats s) => |
648 s.oldSpace.current.instances; | 656 s.oldSpace.current.instances; |
649 } | 657 } |
OLD | NEW |