OLD | NEW |
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 cpu_profile_element; | 5 library cpu_profile_element; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import 'observatory_element.dart'; | 9 import 'observatory_element.dart'; |
10 import 'package:observatory/service.dart'; | 10 import 'package:observatory/service.dart'; |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 this.stackTrace = stackTrace; | 493 this.stackTrace = stackTrace; |
494 _stopWatch.reset(); | 494 _stopWatch.reset(); |
495 return window.animationFrame; | 495 return window.animationFrame; |
496 } | 496 } |
497 | 497 |
498 _update(CpuProfile sampleBuffer) { | 498 _update(CpuProfile sampleBuffer) { |
499 sampleCount = profile.sampleCount.toString(); | 499 sampleCount = profile.sampleCount.toString(); |
500 refreshTime = new DateTime.now().toString(); | 500 refreshTime = new DateTime.now().toString(); |
501 stackDepth = profile.stackDepth.toString(); | 501 stackDepth = profile.stackDepth.toString(); |
502 sampleRate = profile.sampleRate.toStringAsFixed(0); | 502 sampleRate = profile.sampleRate.toStringAsFixed(0); |
503 timeSpan = formatTime(profile.timeSpan); | 503 if (profile.sampleCount == 0) { |
| 504 timeSpan = '0s'; |
| 505 } else { |
| 506 timeSpan = formatTime(profile.timeSpan); |
| 507 } |
504 } | 508 } |
505 | 509 |
506 void tagSelectorChanged(oldValue) { | 510 void tagSelectorChanged(oldValue) { |
507 reload(profile.isolate); | 511 reload(profile.isolate); |
508 } | 512 } |
509 | 513 |
510 Function onSampleBufferUpdate; | 514 Function onSampleBufferUpdate; |
511 @observable bool showTagSelector = true; | 515 @observable bool showTagSelector = true; |
512 | 516 |
513 @observable String sampleCount = ''; | 517 @observable String sampleCount = ''; |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 return; | 1181 return; |
1178 } | 1182 } |
1179 var tree = profile.loadCodeTree(exclusive ? 'exclusive' : 'inclusive'); | 1183 var tree = profile.loadCodeTree(exclusive ? 'exclusive' : 'inclusive'); |
1180 if (tree == null) { | 1184 if (tree == null) { |
1181 return; | 1185 return; |
1182 } | 1186 } |
1183 var rootRow = new CodeProfileTreeRow(codeTree, null, profile, tree.root); | 1187 var rootRow = new CodeProfileTreeRow(codeTree, null, profile, tree.root); |
1184 codeTree.initialize(rootRow); | 1188 codeTree.initialize(rootRow); |
1185 } | 1189 } |
1186 } | 1190 } |
OLD | NEW |