| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 part of cpu_profiler; | 5 part of cpu_profiler; |
| 6 | 6 |
| 7 class CodeCallTreeNode { | 7 class CodeCallTreeNode { |
| 8 final ProfileCode profileCode; | 8 final ProfileCode profileCode; |
| 9 final int count; | 9 final int count; |
| 10 double get percentage => _percentage; | 10 double get percentage => _percentage; |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 _recordCallee(ProfileFunction callee, int count) { | 591 _recordCallee(ProfileFunction callee, int count) { |
| 592 var r = callees[callee]; | 592 var r = callees[callee]; |
| 593 if (r == null) { | 593 if (r == null) { |
| 594 r = 0; | 594 r = 0; |
| 595 } | 595 } |
| 596 callees[callee] = r + count; | 596 callees[callee] = r + count; |
| 597 } | 597 } |
| 598 } | 598 } |
| 599 | 599 |
| 600 | 600 |
| 601 // TODO(johnmccutchan): Rename to SampleProfile |
| 601 class CpuProfile { | 602 class CpuProfile { |
| 602 final double MICROSECONDS_PER_SECOND = 1000000.0; | 603 final double MICROSECONDS_PER_SECOND = 1000000.0; |
| 603 final double displayThreshold = 0.0002; // 0.02%. | 604 final double displayThreshold = 0.0002; // 0.02%. |
| 604 | 605 |
| 605 Isolate isolate; | 606 Isolate isolate; |
| 606 | 607 |
| 607 int sampleCount = 0; | 608 int sampleCount = 0; |
| 608 int samplePeriod = 0; | 609 int samplePeriod = 0; |
| 609 double sampleRate = 0.0; | 610 double sampleRate = 0.0; |
| 610 | 611 |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 int approximateMillisecondsForCount(count) { | 878 int approximateMillisecondsForCount(count) { |
| 878 var MICROSECONDS_PER_MILLISECOND = 1000.0; | 879 var MICROSECONDS_PER_MILLISECOND = 1000.0; |
| 879 return (count * samplePeriod) ~/ MICROSECONDS_PER_MILLISECOND; | 880 return (count * samplePeriod) ~/ MICROSECONDS_PER_MILLISECOND; |
| 880 } | 881 } |
| 881 | 882 |
| 882 double approximateSecondsForCount(count) { | 883 double approximateSecondsForCount(count) { |
| 883 var MICROSECONDS_PER_SECOND = 1000000.0; | 884 var MICROSECONDS_PER_SECOND = 1000000.0; |
| 884 return (count * samplePeriod) / MICROSECONDS_PER_SECOND; | 885 return (count * samplePeriod) / MICROSECONDS_PER_SECOND; |
| 885 } | 886 } |
| 886 } | 887 } |
| OLD | NEW |