mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Add analytics for hot reload events (#5300)
This commit is contained in:
parent
8a58410b76
commit
c13a03fac2
@ -87,11 +87,13 @@ class RunCommand extends RunCommandBase {
|
||||
String get usagePath {
|
||||
Device device = deviceForCommand;
|
||||
|
||||
String command = argResults['hot'] ? 'hotrun' : name;
|
||||
|
||||
if (device == null)
|
||||
return name;
|
||||
return command;
|
||||
|
||||
// Return 'run/ios'.
|
||||
return '$name/${getNameForTargetPlatform(device.platform)}';
|
||||
return '$command/${getNameForTargetPlatform(device.platform)}';
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -342,6 +342,7 @@ class HotRunner extends ResidentRunner {
|
||||
await _launchFromDevFS(_package, _mainPath);
|
||||
restartStatus.stop(showElapsedTime: true);
|
||||
}
|
||||
flutterUsage.sendEvent('hot', 'restart');
|
||||
}
|
||||
|
||||
/// Returns [true] if the reload was successful.
|
||||
@ -373,7 +374,10 @@ class HotRunner extends ResidentRunner {
|
||||
reloadStatus.stop(showElapsedTime: true);
|
||||
if (!_printReloadReport(reloadReport)) {
|
||||
// Reload failed.
|
||||
flutterUsage.sendEvent('hot', 'reload-reject');
|
||||
return false;
|
||||
} else {
|
||||
flutterUsage.sendEvent('hot', 'reload');
|
||||
}
|
||||
} catch (errorMessage) {
|
||||
reloadStatus.stop(showElapsedTime: true);
|
||||
|
Loading…
Reference in New Issue
Block a user