From 221e153f4c3689cc6263aa2251103b3c42abb2aa Mon Sep 17 00:00:00 2001 From: ryanbodrug-microsoft <56318517+ryanbodrug-microsoft@users.noreply.github.com> Date: Tue, 5 May 2020 08:55:29 -0700 Subject: [PATCH] Adding BootEvent for load time telemetry --- src/modules/launcher/PowerLauncher/App.xaml.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/modules/launcher/PowerLauncher/App.xaml.cs b/src/modules/launcher/PowerLauncher/App.xaml.cs index 1e8e5c1d86..894af2fff5 100644 --- a/src/modules/launcher/PowerLauncher/App.xaml.cs +++ b/src/modules/launcher/PowerLauncher/App.xaml.cs @@ -1,3 +1,4 @@ +using Microsoft.PowerLauncher.Telemetry; using System; using System.Diagnostics; using System.Threading.Tasks; @@ -50,6 +51,8 @@ namespace PowerLauncher private void OnStartup(object sender, StartupEventArgs e) { + var bootTime = new System.Diagnostics.Stopwatch(); + bootTime.Start(); Stopwatch.Normal("|App.OnStartup|Startup cost", () => { Log.Info("|App.OnStartup|Begin Wox startup ----------------------------------------------------"); @@ -93,12 +96,14 @@ namespace PowerLauncher _mainVM.MainWindowVisibility = Visibility.Visible; Log.Info("|App.OnStartup|End Wox startup ---------------------------------------------------- "); - + bootTime.Stop(); - //[Conditional("RELEASE")] - // check udpate every 5 hours + PowerLauncherTelemetry.Log.WriteEvent(new BootEvent() { BootTimeMs = bootTime.ElapsedMilliseconds }); - // check updates on startup + //[Conditional("RELEASE")] + // check udpate every 5 hours + + // check updates on startup }); }