mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +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:
@@ -4,11 +4,11 @@
|
||||
|
||||
using System;
|
||||
using System.Web;
|
||||
|
||||
using ManagedCommon;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.Windows.AppLifecycle;
|
||||
using RegistryPreview.Telemetry;
|
||||
using Windows.ApplicationModel.Activation;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
@@ -27,6 +27,8 @@ namespace RegistryPreview
|
||||
/// </summary>
|
||||
public App()
|
||||
{
|
||||
PowerToysTelemetry.Log.WriteEvent(new RegistryPreviewEditorStartEvent() { TimeStamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
|
||||
|
||||
string appLanguage = LanguageHelper.LoadLanguage();
|
||||
|
||||
if (!string.IsNullOrEmpty(appLanguage))
|
||||
|
||||
@@ -3,12 +3,13 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
using ManagedCommon;
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using RegistryPreview.Telemetry;
|
||||
using RegistryPreviewUILib;
|
||||
using Windows.Data.Json;
|
||||
using Windows.Graphics;
|
||||
@@ -87,6 +88,8 @@ namespace RegistryPreview
|
||||
MainPage = new RegistryPreviewMainPage(this, this.UpdateWindowTitle, App.AppFilename);
|
||||
|
||||
WindowHelpers.BringToForeground(windowHandle);
|
||||
|
||||
PowerToysTelemetry.Log.WriteEvent(new RegistryPreviewEditorStartFinishEvent() { TimeStamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
|
||||
}
|
||||
|
||||
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