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 {
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);
......
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