Parse the benchmarks on presubmit jobs (flutter/engine#28586)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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<FlutterDestination> 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<void> main(List<String> args) async {
|
||||
if (args.length != 1) {
|
||||
throw 'Must have one argument: <benchmark_json_file>';
|
||||
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.
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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 "$@"
|
||||
|
||||
Reference in New Issue
Block a user