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

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

Issue 1287033006: Fix time span in profiler (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | runtime/vm/profiler_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/profiler_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698