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 library analyzer_cli.src.perf_report; | 5 library analyzer_cli.src.perf_report; |
6 | 6 |
7 import 'dart:convert' show JsonEncoder; | 7 import 'dart:convert' show JsonEncoder; |
8 import 'dart:io' show Platform; | 8 import 'dart:io' show Platform; |
9 | 9 |
10 import 'package:analyzer/src/generated/utilities_general.dart' | 10 import 'package:analyzer/src/generated/utilities_general.dart' |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 'showSdkWarnings': options.showSdkWarnings, | 59 'showSdkWarnings': options.showSdkWarnings, |
60 'definedVariables': options.definedVariables, | 60 'definedVariables': options.definedVariables, |
61 'packageRootPath': options.packageRootPath, | 61 'packageRootPath': options.packageRootPath, |
62 'packageConfigPath': options.packageConfigPath, | 62 'packageConfigPath': options.packageConfigPath, |
63 'sourceFiles': options.sourceFiles, | 63 'sourceFiles': options.sourceFiles, |
64 }; | 64 }; |
65 | 65 |
66 // Convert performance tags to JSON representation. | 66 // Convert performance tags to JSON representation. |
67 var perfTagsJson = <String, dynamic>{}; | 67 var perfTagsJson = <String, dynamic>{}; |
68 for (PerformanceTag tag in PerformanceTag.all) { | 68 for (PerformanceTag tag in PerformanceTag.all) { |
69 if (tag != PerformanceTag.UNKNOWN) { | 69 if (tag != PerformanceTag.unknown) { |
70 int tagTime = tag.elapsedMs; | 70 int tagTime = tag.elapsedMs; |
71 perfTagsJson[tag.label] = tagTime; | 71 perfTagsJson[tag.label] = tagTime; |
72 otherTime -= tagTime; | 72 otherTime -= tagTime; |
73 } | 73 } |
74 } | 74 } |
75 perfTagsJson['other'] = otherTime; | 75 perfTagsJson['other'] = otherTime; |
76 | 76 |
77 // Generate task table. | 77 // Generate task table. |
78 var taskRows = <_TaskRow>[]; | 78 var taskRows = <_TaskRow>[]; |
79 int totalTaskTime = 0; | 79 int totalTaskTime = 0; |
(...skipping 23 matching lines...) Expand all Loading... |
103 } | 103 } |
104 | 104 |
105 class _TaskRow { | 105 class _TaskRow { |
106 final String name; | 106 final String name; |
107 final int time; | 107 final int time; |
108 final int count; | 108 final int count; |
109 _TaskRow(this.name, this.time, this.count); | 109 _TaskRow(this.name, this.time, this.count); |
110 | 110 |
111 Map toJson() => <String, dynamic>{'name': name, 'time': time, 'count': count}; | 111 Map toJson() => <String, dynamic>{'name': name, 'time': time, 'count': count}; |
112 } | 112 } |
OLD | NEW |