Commit c13a03fa authored by John McCutchan's avatar John McCutchan Committed by GitHub

Add analytics for hot reload events (#5300)

parent 8a58410b
...@@ -87,11 +87,13 @@ class RunCommand extends RunCommandBase { ...@@ -87,11 +87,13 @@ class RunCommand extends RunCommandBase {
String get usagePath { String get usagePath {
Device device = deviceForCommand; Device device = deviceForCommand;
String command = argResults['hot'] ? 'hotrun' : name;
if (device == null) if (device == null)
return name; return command;
// Return 'run/ios'. // Return 'run/ios'.
return '$name/${getNameForTargetPlatform(device.platform)}'; return '$command/${getNameForTargetPlatform(device.platform)}';
} }
@override @override
......
...@@ -342,6 +342,7 @@ class HotRunner extends ResidentRunner { ...@@ -342,6 +342,7 @@ class HotRunner extends ResidentRunner {
await _launchFromDevFS(_package, _mainPath); await _launchFromDevFS(_package, _mainPath);
restartStatus.stop(showElapsedTime: true); restartStatus.stop(showElapsedTime: true);
} }
flutterUsage.sendEvent('hot', 'restart');
} }
/// Returns [true] if the reload was successful. /// Returns [true] if the reload was successful.
...@@ -373,7 +374,10 @@ class HotRunner extends ResidentRunner { ...@@ -373,7 +374,10 @@ class HotRunner extends ResidentRunner {
reloadStatus.stop(showElapsedTime: true); reloadStatus.stop(showElapsedTime: true);
if (!_printReloadReport(reloadReport)) { if (!_printReloadReport(reloadReport)) {
// Reload failed. // Reload failed.
flutterUsage.sendEvent('hot', 'reload-reject');
return false; return false;
} else {
flutterUsage.sendEvent('hot', 'reload');
} }
} catch (errorMessage) { } catch (errorMessage) {
reloadStatus.stop(showElapsedTime: true); reloadStatus.stop(showElapsedTime: true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment