diff --git a/.ci.yaml b/.ci.yaml index fe65209a6305a6abffc0b778cfc825ae63fac478..a920ab83a766beb787d602566ca593ed0c1ec08b 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -142,6 +142,16 @@ targets: presubmit: false properties: build_host: "true" + upload_metrics: "true" + timeout: 60 + scheduler: luci + + - name: Linux Benchmarks (no-upload) + bringup: true + recipe: engine/engine_metrics + properties: + build_host: "true" + upload_metrics: "false" timeout: 60 scheduler: luci diff --git a/testing/benchmark/bin/parse_and_send.dart b/testing/benchmark/bin/parse_and_send.dart index b6319aff3f4428c2e255842cd3aad88fa7797876..0a5e04b63bb46f4f5ecd2c340d9a6a04524b1956 100644 --- a/testing/benchmark/bin/parse_and_send.dart +++ b/testing/benchmark/bin/parse_and_send.dart @@ -7,6 +7,7 @@ import 'dart:convert'; import 'dart:io'; +import 'package:args/args.dart'; import 'package:metrics_center/metrics_center.dart'; import 'package:path/path.dart' as p; @@ -81,11 +82,32 @@ Future connectFlutterDestination() async { ); } +ArgParser _serupOptions() { + final ArgParser parser = ArgParser(); + parser.addOption( + 'json', + mandatory: true, + help: 'Path to the benchmarks json file.', + ); + parser.addFlag( + 'no-upload', + help: 'Upload the parsed benchmarks.', + defaultsTo: false, + ); + return parser; +} + Future main(List args) async { - if (args.length != 1) { - throw 'Must have one argument: '; + final ArgParser parser = _serupOptions(); + final ArgResults options = parser.parse(args); + + final String json = options['json'] as String; + final PointsAndDate pointsAndDate = await parse(json); + + final bool noUpload = options['no-upload'] as bool; + if (noUpload) { + return; } - final PointsAndDate pointsAndDate = await parse(args[0]); // The data will be sent to the Datastore of the GCP project specified through // environment variable BENCHMARK_GCP_CREDENTIALS, or TOKEN_PATH/GCP_PROJECT. diff --git a/testing/benchmark/pubspec.yaml b/testing/benchmark/pubspec.yaml index 9a022df136ef1644c71fa545c9a576efb36fe8be..31e05f21d425bf92b10a232b3abda1e148cf3674 100644 --- a/testing/benchmark/pubspec.yaml +++ b/testing/benchmark/pubspec.yaml @@ -5,7 +5,7 @@ name: flutter_engine_benchmark publish_to: none environment: - sdk: ">=2.2.2 <3.0.0" + sdk: '>=2.12.0-0 <3.0.0' # Do not add any dependencies that require more than what is provided in # //third_party/pkg, //third_party/dart/pkg, or @@ -17,6 +17,7 @@ environment: # relative to this directory into //third_party/dart dependencies: + args: any metrics_center: any path: any @@ -26,6 +27,8 @@ dev_dependencies: dependency_overrides: _discoveryapis_commons: path: ../../../third_party/pkg/googleapis/discoveryapis_commons + args: + path: ../../../third_party/dart/third_party/pkg/args async_helper: path: ../../../third_party/dart/pkg/async_helper async: diff --git a/testing/benchmark/upload_metrics.sh b/testing/benchmark/upload_metrics.sh index 91f29df30797e0f52bbb2827920666ec19409878..f2a1b3acded15637ceedcc0b673febc3c41b94eb 100644 --- a/testing/benchmark/upload_metrics.sh +++ b/testing/benchmark/upload_metrics.sh @@ -37,10 +37,10 @@ DART="${DART_SDK_DIR}/bin/dart" cd "$SCRIPT_DIR" "$DART" --disable-dart-dev bin/parse_and_send.dart \ - ../../../out/host_release/txt_benchmarks.json + --json ../../../out/host_release/txt_benchmarks.json "$@" "$DART" --disable-dart-dev bin/parse_and_send.dart \ - ../../../out/host_release/fml_benchmarks.json + --json ../../../out/host_release/fml_benchmarks.json "$@" "$DART" --disable-dart-dev bin/parse_and_send.dart \ - ../../../out/host_release/shell_benchmarks.json + --json ../../../out/host_release/shell_benchmarks.json "$@" "$DART" --disable-dart-dev bin/parse_and_send.dart \ - ../../../out/host_release/ui_benchmarks.json + --json ../../../out/host_release/ui_benchmarks.json "$@"