mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
[AOT] add some mudole editor open time, timestamp telemetry code (#38008)
* add some mudole editor open time, timestamp telemetry code * fix spelling error * fix namespace warrning --------- Co-authored-by: Zhaopeng Wang (from Dev Box) <zhaopengwang@microsoft.com>
This commit is contained in:
@@ -7,6 +7,7 @@ using System.IO.Abstractions;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
using Common.UI;
|
using Common.UI;
|
||||||
|
using HostsEditor.Telemetry;
|
||||||
using HostsUILib.Helpers;
|
using HostsUILib.Helpers;
|
||||||
using HostsUILib.Settings;
|
using HostsUILib.Settings;
|
||||||
using HostsUILib.ViewModels;
|
using HostsUILib.ViewModels;
|
||||||
@@ -38,6 +39,8 @@ namespace Hosts
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public App()
|
public App()
|
||||||
{
|
{
|
||||||
|
PowerToysTelemetry.Log.WriteEvent(new HostEditorStartEvent() { TimeStamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
|
||||||
|
|
||||||
string appLanguage = LanguageHelper.LoadLanguage();
|
string appLanguage = LanguageHelper.LoadLanguage();
|
||||||
if (!string.IsNullOrEmpty(appLanguage))
|
if (!string.IsNullOrEmpty(appLanguage))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,10 +2,13 @@
|
|||||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
// See the LICENSE file in the project root for more information.
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System;
|
||||||
using Hosts.Helpers;
|
using Hosts.Helpers;
|
||||||
|
using HostsEditor.Telemetry;
|
||||||
using HostsUILib.Helpers;
|
using HostsUILib.Helpers;
|
||||||
using HostsUILib.Views;
|
using HostsUILib.Views;
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Microsoft.UI.Xaml.Controls;
|
using Microsoft.UI.Xaml.Controls;
|
||||||
using Microsoft.UI.Xaml.Media;
|
using Microsoft.UI.Xaml.Media;
|
||||||
@@ -44,6 +47,8 @@ namespace Hosts
|
|||||||
Activated += MainWindow_Activated;
|
Activated += MainWindow_Activated;
|
||||||
|
|
||||||
MainPage = Host.GetService<HostsMainPage>();
|
MainPage = Host.GetService<HostsMainPage>();
|
||||||
|
|
||||||
|
PowerToysTelemetry.Log.WriteEvent(new HostEditorStartFinishEvent() { TimeStamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainWindow_Activated(object sender, WindowActivatedEventArgs args)
|
private void MainWindow_Activated(object sender, WindowActivatedEventArgs args)
|
||||||
|
|||||||
18
src/modules/Hosts/Hosts/Telemetry/HostEditorStartEvent.cs
Normal file
18
src/modules/Hosts/Hosts/Telemetry/HostEditorStartEvent.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation
|
||||||
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System.Diagnostics.Tracing;
|
||||||
|
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
|
using Microsoft.PowerToys.Telemetry.Events;
|
||||||
|
|
||||||
|
namespace HostsEditor.Telemetry;
|
||||||
|
|
||||||
|
[EventData]
|
||||||
|
public class HostEditorStartEvent() : EventBase, IEvent
|
||||||
|
{
|
||||||
|
public long TimeStamp { get; set; }
|
||||||
|
|
||||||
|
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation
|
||||||
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System.Diagnostics.Tracing;
|
||||||
|
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
|
using Microsoft.PowerToys.Telemetry.Events;
|
||||||
|
|
||||||
|
namespace HostsEditor.Telemetry;
|
||||||
|
|
||||||
|
[EventData]
|
||||||
|
public class HostEditorStartFinishEvent() : EventBase, IEvent
|
||||||
|
{
|
||||||
|
public long TimeStamp { get; set; }
|
||||||
|
|
||||||
|
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||||
|
}
|
||||||
@@ -6,10 +6,10 @@ using System;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
|
||||||
using Common.UI;
|
using Common.UI;
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
using Microsoft.PowerToys.Telemetry;
|
using Microsoft.PowerToys.Telemetry;
|
||||||
|
using WorkspacesEditor.Telemetry;
|
||||||
using WorkspacesEditor.Utils;
|
using WorkspacesEditor.Utils;
|
||||||
using WorkspacesEditor.ViewModels;
|
using WorkspacesEditor.ViewModels;
|
||||||
|
|
||||||
@@ -36,6 +36,8 @@ namespace WorkspacesEditor
|
|||||||
|
|
||||||
public App()
|
public App()
|
||||||
{
|
{
|
||||||
|
PowerToysTelemetry.Log.WriteEvent(new WorkspacesEditorStartEvent() { TimeStamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
|
||||||
|
|
||||||
WorkspacesEditorIO = new WorkspacesEditorIO();
|
WorkspacesEditorIO = new WorkspacesEditorIO();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using System.Windows;
|
|||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
using Microsoft.PowerToys.Telemetry;
|
using Microsoft.PowerToys.Telemetry;
|
||||||
|
using WorkspacesEditor.Telemetry;
|
||||||
using WorkspacesEditor.Utils;
|
using WorkspacesEditor.Utils;
|
||||||
using WorkspacesEditor.ViewModels;
|
using WorkspacesEditor.ViewModels;
|
||||||
|
|
||||||
@@ -87,6 +88,8 @@ namespace WorkspacesEditor
|
|||||||
},
|
},
|
||||||
Application.Current.Dispatcher,
|
Application.Current.Dispatcher,
|
||||||
cancellationToken.Token);
|
cancellationToken.Token);
|
||||||
|
|
||||||
|
PowerToysTelemetry.Log.WriteEvent(new WorkspacesEditorStartFinishEvent() { TimeStamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsEditorInsideVisibleArea()
|
private bool IsEditorInsideVisibleArea()
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation
|
||||||
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System.Diagnostics.Tracing;
|
||||||
|
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
|
using Microsoft.PowerToys.Telemetry.Events;
|
||||||
|
|
||||||
|
namespace WorkspacesEditor.Telemetry;
|
||||||
|
|
||||||
|
[EventData]
|
||||||
|
public class WorkspacesEditorStartEvent() : EventBase, IEvent
|
||||||
|
{
|
||||||
|
public long TimeStamp { get; set; }
|
||||||
|
|
||||||
|
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation
|
||||||
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System.Diagnostics.Tracing;
|
||||||
|
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
|
using Microsoft.PowerToys.Telemetry.Events;
|
||||||
|
|
||||||
|
namespace WorkspacesEditor.Telemetry;
|
||||||
|
|
||||||
|
[EventData]
|
||||||
|
public class WorkspacesEditorStartFinishEvent() : EventBase, IEvent
|
||||||
|
{
|
||||||
|
public long TimeStamp { get; set; }
|
||||||
|
|
||||||
|
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||||
|
}
|
||||||
@@ -5,13 +5,15 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
|
||||||
using Common.UI;
|
using Common.UI;
|
||||||
|
using FancyZoneEditor.Telemetry;
|
||||||
using FancyZonesEditor.Utils;
|
using FancyZonesEditor.Utils;
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
|
|
||||||
namespace FancyZonesEditor
|
namespace FancyZonesEditor
|
||||||
{
|
{
|
||||||
@@ -56,6 +58,8 @@ namespace FancyZonesEditor
|
|||||||
|
|
||||||
public App()
|
public App()
|
||||||
{
|
{
|
||||||
|
PowerToysTelemetry.Log.WriteEvent(new FancyZonesEditorStartEvent() { TimeStamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
|
||||||
|
|
||||||
var languageTag = LanguageHelper.LoadLanguage();
|
var languageTag = LanguageHelper.LoadLanguage();
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(languageTag))
|
if (!string.IsNullOrEmpty(languageTag))
|
||||||
|
|||||||
@@ -13,11 +13,12 @@ using System.Windows.Automation.Peers;
|
|||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
|
|
||||||
using Common.UI;
|
using Common.UI;
|
||||||
|
using FancyZoneEditor.Telemetry;
|
||||||
using FancyZonesEditor.Models;
|
using FancyZonesEditor.Models;
|
||||||
using FancyZonesEditor.Utils;
|
using FancyZonesEditor.Utils;
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
using ModernWpf.Controls;
|
using ModernWpf.Controls;
|
||||||
|
|
||||||
namespace FancyZonesEditor
|
namespace FancyZonesEditor
|
||||||
@@ -69,6 +70,8 @@ namespace FancyZonesEditor
|
|||||||
|
|
||||||
// reinit considering work area rect
|
// reinit considering work area rect
|
||||||
_settings.InitModels();
|
_settings.InitModels();
|
||||||
|
|
||||||
|
PowerToysTelemetry.Log.WriteEvent(new FancyZonesEditorStartFinishEvent() { TimeStamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BringToFront()
|
private void BringToFront()
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation
|
||||||
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System.Diagnostics.Tracing;
|
||||||
|
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
|
using Microsoft.PowerToys.Telemetry.Events;
|
||||||
|
|
||||||
|
namespace FancyZoneEditor.Telemetry;
|
||||||
|
|
||||||
|
[EventData]
|
||||||
|
public class FancyZonesEditorStartEvent() : EventBase, IEvent
|
||||||
|
{
|
||||||
|
public long TimeStamp { get; set; }
|
||||||
|
|
||||||
|
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation
|
||||||
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System.Diagnostics.Tracing;
|
||||||
|
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
|
using Microsoft.PowerToys.Telemetry.Events;
|
||||||
|
|
||||||
|
namespace FancyZoneEditor.Telemetry;
|
||||||
|
|
||||||
|
[EventData]
|
||||||
|
public class FancyZonesEditorStartFinishEvent() : EventBase, IEvent
|
||||||
|
{
|
||||||
|
public long TimeStamp { get; set; }
|
||||||
|
|
||||||
|
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||||
|
}
|
||||||
@@ -4,11 +4,11 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
using Microsoft.PowerToys.Telemetry;
|
using Microsoft.PowerToys.Telemetry;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Microsoft.Windows.AppLifecycle;
|
using Microsoft.Windows.AppLifecycle;
|
||||||
|
using RegistryPreview.Telemetry;
|
||||||
using Windows.ApplicationModel.Activation;
|
using Windows.ApplicationModel.Activation;
|
||||||
|
|
||||||
// To learn more about WinUI, the WinUI project structure,
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
@@ -27,6 +27,8 @@ namespace RegistryPreview
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public App()
|
public App()
|
||||||
{
|
{
|
||||||
|
PowerToysTelemetry.Log.WriteEvent(new RegistryPreviewEditorStartEvent() { TimeStamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
|
||||||
|
|
||||||
string appLanguage = LanguageHelper.LoadLanguage();
|
string appLanguage = LanguageHelper.LoadLanguage();
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(appLanguage))
|
if (!string.IsNullOrEmpty(appLanguage))
|
||||||
|
|||||||
@@ -3,12 +3,13 @@
|
|||||||
// See the LICENSE file in the project root for more information.
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
using ManagedCommon;
|
using ManagedCommon;
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
using Microsoft.UI;
|
using Microsoft.UI;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Microsoft.UI.Xaml.Controls;
|
using Microsoft.UI.Xaml.Controls;
|
||||||
using Microsoft.UI.Xaml.Media;
|
using Microsoft.UI.Xaml.Media;
|
||||||
|
using RegistryPreview.Telemetry;
|
||||||
using RegistryPreviewUILib;
|
using RegistryPreviewUILib;
|
||||||
using Windows.Data.Json;
|
using Windows.Data.Json;
|
||||||
using Windows.Graphics;
|
using Windows.Graphics;
|
||||||
@@ -87,6 +88,8 @@ namespace RegistryPreview
|
|||||||
MainPage = new RegistryPreviewMainPage(this, this.UpdateWindowTitle, App.AppFilename);
|
MainPage = new RegistryPreviewMainPage(this, this.UpdateWindowTitle, App.AppFilename);
|
||||||
|
|
||||||
WindowHelpers.BringToForeground(windowHandle);
|
WindowHelpers.BringToForeground(windowHandle);
|
||||||
|
|
||||||
|
PowerToysTelemetry.Log.WriteEvent(new RegistryPreviewEditorStartFinishEvent() { TimeStamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainWindow_Activated(object sender, WindowActivatedEventArgs args)
|
private void MainWindow_Activated(object sender, WindowActivatedEventArgs args)
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation
|
||||||
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System.Diagnostics.Tracing;
|
||||||
|
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
|
using Microsoft.PowerToys.Telemetry.Events;
|
||||||
|
|
||||||
|
namespace RegistryPreview.Telemetry;
|
||||||
|
|
||||||
|
[EventData]
|
||||||
|
public class RegistryPreviewEditorStartEvent() : EventBase, IEvent
|
||||||
|
{
|
||||||
|
public long TimeStamp { get; set; }
|
||||||
|
|
||||||
|
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation
|
||||||
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||||
|
// See the LICENSE file in the project root for more information.
|
||||||
|
|
||||||
|
using System.Diagnostics.Tracing;
|
||||||
|
|
||||||
|
using Microsoft.PowerToys.Telemetry;
|
||||||
|
using Microsoft.PowerToys.Telemetry.Events;
|
||||||
|
|
||||||
|
namespace RegistryPreview.Telemetry;
|
||||||
|
|
||||||
|
[EventData]
|
||||||
|
public class RegistryPreviewEditorStartFinishEvent() : EventBase, IEvent
|
||||||
|
{
|
||||||
|
public long TimeStamp { get; set; }
|
||||||
|
|
||||||
|
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user