Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
28 changes: 25 additions & 3 deletions testing/benchmark/bin/parse_and_send.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion testing/benchmark/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,6 +17,7 @@ environment:
# relative to this directory into //third_party/dart

dependencies:
args: any
metrics_center: any
path: any

Expand All @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions testing/benchmark/upload_metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"