Gitea CI / Check code and tests (pull_request) Failing after 7m0s
Gitea CI / Gitea CI passed (pull_request) Failing after 5s
Gitea CI / Build Android APK (pull_request) Skipped
Gitea CI / Build Windows x64 app (pull_request) Skipped
Gitea CI / Audit and package Windows x64 (pull_request) Skipped
Gitea CI / Assemble and validate CI artifacts (pull_request) Skipped
25 lines
775 B
Dart
25 lines
775 B
Dart
// Opt-in profiler of the existing full app; normal launches do no benchmark work.
|
|
import 'dart:async';
|
|
import 'dart:io';
|
|
|
|
import 'full_app_viewport_bench/config.dart';
|
|
import 'full_app_viewport_bench/runner.dart';
|
|
|
|
void startFullAppViewportBenchFromEnvironment() {
|
|
final output = Platform.environment['CUTDEX_FULL_APP_VIEWPORT_BENCH'];
|
|
if (output == null || output.isEmpty) return;
|
|
unawaited(_start(output));
|
|
}
|
|
|
|
Future<void> _start(String output) async {
|
|
try {
|
|
await runFullAppViewportBench(
|
|
ViewportBenchConfig.fromEnvironment(Platform.environment),
|
|
);
|
|
} catch (error, stack) {
|
|
final directory = Directory(output);
|
|
await directory.create(recursive: true);
|
|
await File('${directory.path}/error.txt').writeAsString('$error\n$stack');
|
|
}
|
|
}
|