mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 21:41:51 +02:00
Adding BootEvent for load time telemetry
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using Microsoft.PowerLauncher.Telemetry;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -50,6 +51,8 @@ namespace PowerLauncher
|
|||||||
|
|
||||||
private void OnStartup(object sender, StartupEventArgs e)
|
private void OnStartup(object sender, StartupEventArgs e)
|
||||||
{
|
{
|
||||||
|
var bootTime = new System.Diagnostics.Stopwatch();
|
||||||
|
bootTime.Start();
|
||||||
Stopwatch.Normal("|App.OnStartup|Startup cost", () =>
|
Stopwatch.Normal("|App.OnStartup|Startup cost", () =>
|
||||||
{
|
{
|
||||||
Log.Info("|App.OnStartup|Begin Wox startup ----------------------------------------------------");
|
Log.Info("|App.OnStartup|Begin Wox startup ----------------------------------------------------");
|
||||||
@@ -93,12 +96,14 @@ namespace PowerLauncher
|
|||||||
_mainVM.MainWindowVisibility = Visibility.Visible;
|
_mainVM.MainWindowVisibility = Visibility.Visible;
|
||||||
Log.Info("|App.OnStartup|End Wox startup ---------------------------------------------------- ");
|
Log.Info("|App.OnStartup|End Wox startup ---------------------------------------------------- ");
|
||||||
|
|
||||||
|
bootTime.Stop();
|
||||||
|
|
||||||
|
PowerLauncherTelemetry.Log.WriteEvent(new BootEvent() { BootTimeMs = bootTime.ElapsedMilliseconds });
|
||||||
|
|
||||||
//[Conditional("RELEASE")]
|
//[Conditional("RELEASE")]
|
||||||
// check udpate every 5 hours
|
// check udpate every 5 hours
|
||||||
|
|
||||||
// check updates on startup
|
// check updates on startup
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user