Gitea CI / Check code and tests (push) Successful in 8m7s
Gitea CI / Build Windows x64 app (push) Successful in 5m48s
Gitea CI / Build Android APK (push) Successful in 5m59s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m17s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m22s
Gitea CI / Gitea CI passed (push) Successful in 2s
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');
|
|
}
|
|
}
|