未验证 提交 064ab389 编写于 作者: K Kevin Pilch 提交者: GitHub

Merge pull request #24870 from Pilchie/Fix568001-IntelliSenseTelemetry

Add telemetry for when projects are created/pushed/etc
......@@ -15,6 +15,7 @@
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.ErrorReporting;
using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Internal.Log;
using Microsoft.CodeAnalysis.Notification;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.VisualStudio.ComponentModelHost;
......@@ -37,6 +38,8 @@ namespace Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem
internal abstract partial class AbstractProject : ForegroundThreadAffinitizedObject, IVisualStudioHostProject
#pragma warning restore CS0618 // IVisualStudioHostProject is obsolete
{
private const string ProjectGuidPropertyName = "ProjectGuid";
internal static object RuleSetErrorId = new object();
private readonly object _gate = new object();
......@@ -171,6 +174,12 @@ internal abstract partial class AbstractProject : ForegroundThreadAffinitizedObj
}
UpdateAssemblyName();
Logger.Log(FunctionId.AbstractProject_Created,
KeyValueLogMessage.Create(LogType.Trace, m =>
{
m[ProjectGuidPropertyName] = Guid;
}));
}
internal IServiceProvider ServiceProvider { get; }
......@@ -318,9 +327,17 @@ public ProjectInfo CreateProjectInfoForCurrentState()
protected void SetIntellisenseBuildResultAndNotifyWorkspaceHosts(bool succeeded)
{
// set intellisense related info
// set IntelliSense related info
LastDesignTimeBuildSucceeded = succeeded;
Logger.Log(FunctionId.AbstractProject_SetIntelliSenseBuild,
KeyValueLogMessage.Create(LogType.Trace, m =>
{
m[ProjectGuidPropertyName] = Guid;
m[nameof(LastDesignTimeBuildSucceeded)] = LastDesignTimeBuildSucceeded;
m[nameof(PushingChangesToWorkspaceHosts)] = PushingChangesToWorkspaceHosts;
}));
if (PushingChangesToWorkspaceHosts)
{
// set workspace reference info
......@@ -1361,6 +1378,11 @@ protected virtual void OnDocumentRemoved(string filePath)
internal void StartPushingToWorkspaceHosts()
{
_pushingChangesToWorkspaceHosts = true;
Logger.Log(FunctionId.AbstractProject_PushedToWorkspace,
KeyValueLogMessage.Create(LogType.Trace, m =>
{
m[ProjectGuidPropertyName] = Guid;
}));
}
internal void StopPushingToWorkspaceHosts()
......
......@@ -403,5 +403,9 @@ internal enum FunctionId
MetadataOnlyImage_EmitFailure,
LiveTableDataSource_OnDiagnosticsUpdated,
Experiment_KeybindingsReset,
AbstractProject_SetIntelliSenseBuild,
AbstractProject_Created,
AbstractProject_PushedToWorkspace,
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册