[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:
dreamstart
2025-03-18 21:52:24 +08:00
committed by GitHub
parent 1f81d14000
commit 4377de260f
16 changed files with 174 additions and 5 deletions

View File

@@ -6,10 +6,10 @@ using System;
using System.Globalization;
using System.Threading;
using System.Windows;
using Common.UI;
using ManagedCommon;
using Microsoft.PowerToys.Telemetry;
using WorkspacesEditor.Telemetry;
using WorkspacesEditor.Utils;
using WorkspacesEditor.ViewModels;
@@ -36,6 +36,8 @@ namespace WorkspacesEditor
public App()
{
PowerToysTelemetry.Log.WriteEvent(new WorkspacesEditorStartEvent() { TimeStamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
WorkspacesEditorIO = new WorkspacesEditorIO();
}

View File

@@ -10,6 +10,7 @@ using System.Windows;
using System.Windows.Interop;
using ManagedCommon;
using Microsoft.PowerToys.Telemetry;
using WorkspacesEditor.Telemetry;
using WorkspacesEditor.Utils;
using WorkspacesEditor.ViewModels;
@@ -87,6 +88,8 @@ namespace WorkspacesEditor
},
Application.Current.Dispatcher,
cancellationToken.Token);
PowerToysTelemetry.Log.WriteEvent(new WorkspacesEditorStartFinishEvent() { TimeStamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() });
}
private bool IsEditorInsideVisibleArea()

View 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 WorkspacesEditor.Telemetry;
[EventData]
public class WorkspacesEditorStartEvent() : EventBase, IEvent
{
public long TimeStamp { get; set; }
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
}

View 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 WorkspacesEditor.Telemetry;
[EventData]
public class WorkspacesEditorStartFinishEvent() : EventBase, IEvent
{
public long TimeStamp { get; set; }
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServiceUsage;
}