提交 d37d9931 编写于 作者: K kayleh

Add telemetry for Edit and Continue rude edits while debugging. (changeset 1249391)

上级 db06992e
......@@ -13,5 +13,6 @@ internal interface ITelemetryService : IWorkspaceService
void EndCurrentSession();
void LogRenameSession(RenameSessionInfo renameSession);
void LogLightBulbSession(LightBulbSessionInfo lightBulbSession);
void LogEncDebugSession(EncDebuggingSessionInfo session);
}
}
// Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading;
using System.Collections.Generic;
using Microsoft.CodeAnalysis.Options;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.Internal.Log.Telemetry
{
......@@ -86,4 +85,42 @@ internal struct LightBulbSessionInfo
this.ExtendedFlagsOfSelectedItem = extendedFlagsOfSelectedItem;
}
}
internal class EncDebuggingSessionInfo
{
public readonly List<EncEditSessionInfo> EditSessions = new List<EncEditSessionInfo>();
public int EmptyEditSessions = 0;
internal void EndEditSession(EncEditSessionInfo encEditSessionInfo)
{
if (encEditSessionInfo.IsEmpty())
{
EmptyEditSessions++;
}
else
{
EditSessions.Add(encEditSessionInfo);
}
}
}
internal class EncEditSessionInfo
{
public readonly HashSet<ValueTuple<ushort, ushort>> RudeEdits = new HashSet<ValueTuple<ushort, ushort>>();
public IEnumerable<string> EmitDeltaErrorIds;
public bool HadCompilationErrors;
public bool HadRudeEdits;
public bool HadValidChanges;
public bool HadValidInsignificantChanges;
internal void LogRudeEdit(ushort kind, ushort syntaxKind)
{
RudeEdits.Add(ValueTuple.Create(kind, syntaxKind));
}
internal bool IsEmpty()
{
return !(HadCompilationErrors || HadRudeEdits || HadValidChanges || HadValidInsignificantChanges);
}
}
}
......@@ -19,7 +19,7 @@ private class EmptyTelemetryLogger : ITelemetryService
void ITelemetryService.EndCurrentSession()
{
}
void ITelemetryService.LogLightBulbSession(Telemetry.LightBulbSessionInfo lightBulbSession)
{
}
......@@ -27,6 +27,10 @@ void ITelemetryService.LogLightBulbSession(Telemetry.LightBulbSessionInfo lightB
void ITelemetryService.LogRenameSession(Telemetry.RenameSessionInfo renameSession)
{
}
void ITelemetryService.LogEncDebugSession(Telemetry.EncDebuggingSessionInfo session)
{
}
}
}
}
......@@ -522,7 +522,9 @@
<Compile Include="Log\ITelemetry.cs" />
<Compile Include="Log\Logger.cs" />
<Compile Include="Log\RoslynEventSource.cs" />
<Compile Include="Log\Telemetry.Parameters.cs" />
<Compile Include="Log\Telemetry.Parameters.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
<Compile Include="Log\TelemetryWorkspaceServiceFactory.cs" />
<Compile Include="Log\TraceLogger.cs" />
<Compile Include="Notification\AbstractGlobalOperationNotificationService.cs" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册