Visitar URL original
Log raw output lines for debugging (#47) · creatorpiyush/packages@1f90a86 · GitHub
Skip to content

Commit 1f90a86

Browse files
authored
Log raw output lines for debugging (flutter#47)
This would help debug flutter/flutter#45194
1 parent e4ed444 commit 1f90a86

4 files changed

Lines changed: 13 additions & 8 deletions

File tree

‎packages/gauge/CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.1.5
2+
3+
* Print more logs for debugging.
4+
15
## 0.1.4
26

37
* Download depot_tools automatically.

‎packages/gauge/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ compatible.
66

77
# Install
88

9-
First install Xcode 10 (https://developer.apple.com/download/more/),
9+
First install Xcode 10.3 (https://developer.apple.com/download/more/),
1010
[dart](https://dart.dev/get-dart), and
1111
[git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
1212
Make sure that `pub`, `git`, and `instruments` are on your path.

‎packages/gauge/lib/parser.dart‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class IosTraceParser {
3131
final bool isVerbose;
3232
final String traceUtilityPath;
3333

34+
List<String> _lines;
3435
List<String> _gpuMeasurements;
3536
List<String> _cpuMeasurements;
3637

@@ -44,13 +45,13 @@ class IosTraceParser {
4445
print('TraceUtility stderr:\n${result.stderr.toString}\n\n');
4546
throw Exception('TraceUtility failed with exit code ${result.exitCode}');
4647
}
47-
final List<String> lines = result.stderr.toString().split('\n');
48+
_lines = result.stderr.toString().split('\n');
4849

4950
// toSet to remove duplicates
5051
_gpuMeasurements =
51-
lines.where((String s) => s.contains('GPU')).toSet().toList();
52+
_lines.where((String s) => s.contains('GPU')).toSet().toList();
5253
_cpuMeasurements =
53-
lines.where((String s) => s.contains(processName)).toSet().toList();
54+
_lines.where((String s) => s.contains(processName)).toSet().toList();
5455
_gpuMeasurements.sort();
5556
_cpuMeasurements.sort();
5657

@@ -107,8 +108,9 @@ class IosTraceParser {
107108

108109
double _average(Iterable<double> values) {
109110
if (values == null || values.isEmpty) {
110-
_gpuMeasurements.forEach(print);
111-
_cpuMeasurements.forEach(print);
111+
print('TraceUtility output:\n${_lines.join('\n')}\n\n');
112+
print('GPU measurements:\n${_gpuMeasurements.join('\n')}\n\n');
113+
print('CPU measurements:\n${_cpuMeasurements.join('\n')}\n\n');
112114
throw Exception('No valid measurements found.');
113115
}
114116
return values.reduce((double a, double b) => a + b) / values.length;

‎packages/gauge/pubspec.yaml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ description:
44

55
Currently there's only one tool to measure iOS CPU/GPU usages for Flutter's CI
66
tests.
7-
author: Flutter Team <flutter-dev@googlegroups.com>
87
homepage: https://github.com/flutter/packages/tree/master/packages/gauge
9-
version: 0.1.4
8+
version: 0.1.5
109

1110
executables:
1211
gauge: gauge

0 commit comments

Comments
 (0)