Skip to content

Commit 35f872e

Browse files
authored
Merge pull request #1589 from paulvanbrenk/telemetry15.3
Telemetry 15.3
2 parents 1c02088 + 3544b1d commit 35f872e

27 files changed

+258
-84
lines changed
-16.5 KB
Binary file not shown.
-16.5 KB
Binary file not shown.
Binary file not shown.
-16.5 KB
Binary file not shown.

Nodejs/Common/Telemetry/TelemetryEvents.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

Nodejs/Common/Telemetry/TelemetryProperties.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

Nodejs/Product/Nodejs/Debugger/NodeDebugProvider.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.ComponentModel.Composition;
55
using System.IO;
66
using Microsoft.NodejsTools.Project;
7+
using Microsoft.NodejsTools.Telemetry;
78
using Microsoft.VisualStudio.Setup.Configuration;
89
using Microsoft.VisualStudio.Shell.Interop;
910
using Microsoft.VisualStudio.Workspace;
@@ -47,16 +48,18 @@ internal class NodeJsDebugLaunchProvider : IVsDebugLaunchTargetProvider
4748

4849
public void SetupDebugTargetInfo(ref VsDebugTargetInfo vsDebugTargetInfo, DebugLaunchActionContext debugLaunchContext)
4950
{
50-
var nodeExe = debugLaunchContext.LaunchConfiguration.GetValue<string>(NodeExeKey, defaultValue: Nodejs.GetPathToNodeExecutableFromEnvironment());
51+
var nodeExe = debugLaunchContext.LaunchConfiguration.GetValue(NodeExeKey, defaultValue: Nodejs.GetPathToNodeExecutableFromEnvironment());
5152

5253
var nodeVersion = Nodejs.GetNodeVersion(nodeExe);
5354
if (nodeVersion >= new Version(8, 0) || NodejsProjectLauncher.CheckDebugProtocolOption())
5455
{
5556
SetupDebugTargetInfoForWebkitV2Protocol(ref vsDebugTargetInfo, debugLaunchContext, nodeExe);
57+
TelemetryHelper.LogDebuggingStarted("ChromeV2", nodeVersion.ToString(), isProject: false);
5658
}
5759
else
5860
{
5961
this.SetupDebugTargetInfoForNodeProtocol(ref vsDebugTargetInfo, debugLaunchContext, nodeExe);
62+
TelemetryHelper.LogDebuggingStarted("Node6", nodeVersion.ToString(), isProject: false);
6063
}
6164
}
6265

@@ -117,7 +120,7 @@ private void SetupDebugTargetInfoForWebkitV2Protocol(ref VsDebugTargetInfo vsDeb
117120
new JProperty("runtimeExecutable", nodeExe),
118121
new JProperty("cwd", cwd),
119122
new JProperty("console", "externalTerminal"),
120-
new JProperty("diagnosticLogging", NodejsProjectLauncher.CheckEnableDiagnosticLoggingOption()),
123+
new JProperty("trace", NodejsProjectLauncher.CheckEnableDiagnosticLoggingOption()),
121124
new JProperty("sourceMaps", true),
122125
new JProperty("stopOnEntry", true),
123126
new JProperty("$adapter", pathToNodeExe),

Nodejs/Product/Nodejs/Nodejs.csproj

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
<UpgradeBackupLocation>
88
</UpgradeBackupLocation>
99
<OldToolsVersion>4.0</OldToolsVersion>
10+
<NuGetPackageImportStamp>
11+
</NuGetPackageImportStamp>
1012
</PropertyGroup>
1113
<Import Project="..\ProjectBefore.settings" />
1214
<PropertyGroup>
@@ -60,6 +62,9 @@
6062
<Reference Include="Microsoft.ApplicationInsights.PersistenceChannel, Version=1.2.3.490, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6163
<HintPath>..\..\packages\Microsoft.ApplicationInsights.PersistenceChannel.1.2.3\lib\net45\Microsoft.ApplicationInsights.PersistenceChannel.dll</HintPath>
6264
</Reference>
65+
<Reference Include="Microsoft.Diagnostics.Tracing.EventSource, Version=1.1.16.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
66+
<HintPath>..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\lib\net45\Microsoft.Diagnostics.Tracing.EventSource.dll</HintPath>
67+
</Reference>
6368
<Reference Include="Microsoft.VisualStudio.ImageCatalog, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
6469
<Reference Include="Microsoft.VisualStudio.Imaging, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
6570
<!--
@@ -69,6 +74,9 @@
6974
<Reference Include="Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
7075
<EmbedInteropTypes>True</EmbedInteropTypes>
7176
</Reference>
77+
<Reference Include="Microsoft.VisualStudio.RemoteControl, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
78+
<HintPath>..\..\packages\Microsoft.VisualStudio.RemoteControl.14.0.262-masterA5CACE98\lib\net45\Microsoft.VisualStudio.RemoteControl.dll</HintPath>
79+
</Reference>
7280
<Reference Include="Microsoft.VisualStudio.Setup.Configuration.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
7381
<HintPath>..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Interop.1.8.24\lib\net35\Microsoft.VisualStudio.Setup.Configuration.Interop.dll</HintPath>
7482
<EmbedInteropTypes>True</EmbedInteropTypes>
@@ -88,6 +96,9 @@
8896
<Reference Include="Microsoft.VisualStudio.Shell.Interop.15.3.DesignTime, Version=15.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
8997
<EmbedInteropTypes>True</EmbedInteropTypes>
9098
</Reference>
99+
<Reference Include="Microsoft.VisualStudio.Telemetry, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
100+
<HintPath>..\..\packages\Microsoft.VisualStudio.Telemetry.15.3.789-masterCC863119\lib\net45\Microsoft.VisualStudio.Telemetry.dll</HintPath>
101+
</Reference>
91102
<Reference Include="Microsoft.VisualStudio.Utilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
92103
</ItemGroup>
93104
<ItemGroup>
@@ -103,6 +114,9 @@
103114
<Reference Include="Microsoft.VisualStudio.TextManager.Interop.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
104115
<EmbedInteropTypes>True</EmbedInteropTypes>
105116
</Reference>
117+
<Reference Include="Microsoft.VisualStudio.Utilities.Internal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
118+
<HintPath>..\..\packages\Microsoft.VisualStudio.Utilities.Internal.14.0.72-masterF9EB1D39\lib\net45\Microsoft.VisualStudio.Utilities.Internal.dll</HintPath>
119+
</Reference>
106120
<Reference Include="Microsoft.VisualStudio.Validation, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
107121
<HintPath>..\..\packages\Microsoft.VisualStudio.Validation.15.0.82\lib\net45\Microsoft.VisualStudio.Validation.dll</HintPath>
108122
<Private>True</Private>
@@ -136,9 +150,6 @@
136150
<Reference Include="Microsoft.Build.Utilities.$(MicrosoftBuildAssemblyVersionSuffix), Version=$(MicrosoftBuildAssemblyVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
137151
<Reference Include="Microsoft.CSharp" />
138152
<Reference Include="Microsoft.JScript" />
139-
<Reference Include="Microsoft.NodejsTools.Telemetry">
140-
<HintPath>..\..\Common\Telemetry\Microsoft.NodejsTools.Telemetry.15.0.dll</HintPath>
141-
</Reference>
142153
<Reference Include="microsoft.msxml, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
143154
<EmbedInteropTypes>False</EmbedInteropTypes>
144155
</Reference>
@@ -206,9 +217,6 @@
206217
<ItemGroup>
207218
<Reference Include="Microsoft.VisualStudio.Shell.Framework, Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
208219
</ItemGroup>
209-
<ItemGroup>
210-
<OutputBinariesToSign Include="Microsoft.NodejsTools.Telemetry.$(VSTarget).dll" />
211-
</ItemGroup>
212220
<ItemGroup>
213221
<Compile Include="..\TypeScript\TypeScriptHelpers.cs">
214222
<Link>Project\TypeScriptHelpers.cs</Link>
@@ -459,6 +467,7 @@
459467
<Compile Include="Repl\SaveReplCommand.cs" />
460468
<Compile Include="Repl\VsNodejsReplSite.cs" />
461469
<Compile Include="SourceMapping\SourceMap.cs" />
470+
<Compile Include="Telemetry\TelemetryEvents.cs" />
462471
<Compile Include="TestFrameworks\TestFrameworkDirectories.cs" />
463472
<Compile Include="VsMenus.cs" />
464473
<Compile Include="BaseNodeProjectFactory.cs" />
@@ -525,14 +534,7 @@
525534
<Compile Include="GlobalSuppressions.cs" />
526535
<Compile Include="NodejsPackage.cs" />
527536
<Compile Include="Properties\AssemblyInfo.cs" />
528-
<Compile Include="Telemetry\NodejsTelemetryExtensions.cs" />
529-
</ItemGroup>
530-
<ItemGroup>
531-
<TelemetryFiles Include="..\..\Common\Telemetry\*.cs" />
532-
<Compile Include="@(TelemetryFiles)">
533-
<Link>Telemetry\%(TelemetryFiles.FileName).cs</Link>
534-
<Visible>true</Visible>
535-
</Compile>
537+
<Compile Include="Telemetry\TelemetryHelper.cs" />
536538
</ItemGroup>
537539
<ItemGroup>
538540
<EmbeddedResource Include="ImportWizardResources.cs.resx" />
@@ -866,11 +868,6 @@
866868
<ZipProject Include="ProjectTemplates\NodejsWebApp\Preview.png" />
867869
<ZipProject Include="ProjectTemplates\AzureNodejsApp\Preview.png" />
868870
<ZipProject Include="ProjectTemplates\NodejsConsoleApp\Preview.png" />
869-
<Content Include="..\..\Common\Telemetry\Microsoft.NodejsTools.Telemetry.$(VSTarget).dll">
870-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
871-
<IncludeInVSIX>true</IncludeInVSIX>
872-
<VSIXSubPath>.</VSIXSubPath>
873-
</Content>
874871
<Content Include="$(OutputPath)\Newtonsoft.Json.dll">
875872
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
876873
<IncludeInVSIX>true</IncludeInVSIX>
@@ -1046,6 +1043,7 @@
10461043
<Content Include="TestFrameworks\Tape\tape.js">
10471044
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
10481045
</Content>
1046+
<Resource Include="version.txt" />
10491047
<Content Include="VSTemplateStore.pkgdef">
10501048
<IncludeInVSIX>false</IncludeInVSIX>
10511049
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -1284,6 +1282,7 @@
12841282
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
12851283
</PropertyGroup>
12861284
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
1285+
<Error Condition="!Exists('..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets'))" />
12871286
</Target>
12881287
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
12891288
Other similar extension points exist, see Microsoft.Common.targets.
@@ -1319,4 +1318,5 @@
13191318
<Target Name="_DeleteAfterCreatePkgDef" AfterTargets="GeneratePkgDef">
13201319
<Delete Files="@(_CopiedForCreatePkgdef)" />
13211320
</Target>
1321+
<Import Project="..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets" Condition="Exists('..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.16-beta\build\portable-net45+win8+wpa81\Microsoft.Diagnostics.Tracing.EventSource.Redist.targets')" />
13221322
</Project>

Nodejs/Product/Nodejs/NodejsPackage.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ internal sealed partial class NodejsPackage : CommonPackage
7070
internal static NodejsPackage Instance;
7171
internal HashSet<ITextBuffer> ChangedBuffers = new HashSet<ITextBuffer>();
7272
private NodejsToolsLogger _logger;
73-
private ITelemetryLogger _telemetryLogger;
7473
// Hold references for the subscribed events. Otherwise the callbacks will be garbage collected
7574
// after the initialization
7675
private List<EnvDTE.CommandEvents> _subscribedCommandEvents = new List<EnvDTE.CommandEvents>();
@@ -185,20 +184,15 @@ private void InitializeLogging()
185184

186185
private void InitializeTelemetry()
187186
{
188-
var thisAssembly = typeof(NodejsPackage).Assembly;
189-
190-
// Get telemetry logger
191-
this._telemetryLogger = TelemetrySetup.Instance.GetLogger(thisAssembly);
192-
193-
TelemetrySetup.Instance.LogPackageLoad(this._telemetryLogger, Guid.Parse(Guids.NodejsPackageString), thisAssembly, Application.ProductVersion);
187+
// Fetch the session synchronously on the UI thread; if this doesn't happen before we try using this on
188+
// the background thread then the VS process will deadlock.
189+
TelemetryHelper.Initialize();
194190
}
195191

196192
public new IComponentModel ComponentModel => this.GetComponentModel();
197193

198194
internal NodejsToolsLogger Logger => this._logger;
199195

200-
internal ITelemetryLogger TelemetryLogger => this._telemetryLogger;
201-
202196
/// <summary>
203197
/// Makes the debugger context available - this enables our debugger when we're installed into
204198
/// a SKU which doesn't support every installed debugger.

Nodejs/Product/Nodejs/NpmUI/NpmPackageInstallViewModel.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.Windows.Input;
1111
using System.Windows.Threading;
1212
using Microsoft.NodejsTools.Npm;
13+
using Microsoft.NodejsTools.Telemetry;
1314
using Microsoft.VisualStudio.Shell;
1415

1516
namespace Microsoft.NodejsTools.NpmUI
@@ -302,6 +303,9 @@ internal void Install(PackageCatalogEntryViewModel package)
302303
if (!string.IsNullOrEmpty(package.Name))
303304
{
304305
var selectedVersion = this.SelectedVersion is SemverVersion ? ((SemverVersion)this.SelectedVersion).ToString() : string.Empty;
306+
307+
TelemetryHelper.LogInstallNpmPackage();
308+
305309
this.npmWorker.QueueCommand(
306310
NpmArgumentBuilder.GetNpmInstallArguments(
307311
package.Name,

0 commit comments

Comments
 (0)