-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Telemetry #381
Telemetry #381
Changes from 6 commits
f44fa19
9be9c55
56816dd
f56f37a
b16a3a4
6dca996
61cbdb2
29709e9
19fb6a8
d4b14b6
c24868e
1b57cc7
ed3c4e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,6 @@ | |
<OutputSubPath>Node.js</OutputSubPath> | ||
</VSTemplate> | ||
</ItemDefinitionGroup> | ||
|
||
<Choose> | ||
<When Condition="'$(VSTarget)' != '11.0' And '$(VSTarget)' != '12.0'"> | ||
<ItemGroup> | ||
|
@@ -105,6 +104,9 @@ | |
<Reference Include="Microsoft.Build.Utilities.$(MicrosoftBuildAssemblyVersionSuffix), Version=$(MicrosoftBuildAssemblyVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="Microsoft.JScript" /> | ||
<Reference Include="Microsoft.NodejsTools.Telemetry"> | ||
<HintPath>..\..\Common\Telemetry\Microsoft.NodejsTools.Telemetry.$(VSTarget).dll</HintPath> | ||
</Reference> | ||
<Reference Include="Microsoft.VisualStudio.ComponentModelHost, Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> | ||
<Reference Include="Microsoft.VisualStudio.CoreUtility, Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> | ||
<Reference Include="Microsoft.VisualStudio.Debugger.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> | ||
|
@@ -613,6 +615,8 @@ | |
<Compile Include="SmartIndent.cs" /> | ||
<Compile Include="SmartIndentProvider.cs" /> | ||
<Compile Include="SourceMapping\SourceMap.cs" /> | ||
<Compile Include="Telemetry\TelemetryEvents.cs" /> | ||
<Compile Include="Telemetry\TelemetryProperties.cs" /> | ||
<Compile Include="TestFrameworks\TestFrameworkDirectories.cs" /> | ||
<Compile Include="VsMenus.cs" /> | ||
<Compile Include="AzureSolutionListener.cs" /> | ||
|
@@ -809,6 +813,23 @@ | |
<ZipProject Include="ProjectTemplates\AddWebSiteAzureExpressApp\Preview.png" /> | ||
<ZipProject Include="ProjectTemplates\AzureNodejsApp\Preview.png" /> | ||
<ZipProject Include="ProjectTemplates\NodejsConsoleApp\Preview.png" /> | ||
<Content Include="..\..\Common\Telemetry\Microsoft.NodejsTools.Telemetry.$(VSTarget).dll"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<IncludeInVSIX>true</IncludeInVSIX> | ||
<VSIXSubPath>.</VSIXSubPath> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: fix the indentation here and below too (spaces, not tabs) |
||
</Content> | ||
<Content Include="..\..\packages\Microsoft.ApplicationInsights.1.2.0\lib\net45\Microsoft.ApplicationInsights.dll"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No better place to put this - why is .nuget/nuget.exe being checked into the project? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nvm, as we discussed - didn't realize it was replacing with a new version |
||
<Link>Microsoft.ApplicationInsights.dll</Link> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<IncludeInVSIX>true</IncludeInVSIX> | ||
<VSIXSubPath>.</VSIXSubPath> | ||
</Content> | ||
<Content Include="..\..\packages\Microsoft.ApplicationInsights.PersistenceChannel.1.2.0\lib\net45\Microsoft.ApplicationInsights.PersistenceChannel.dll"> | ||
<Link>Microsoft.ApplicationInsights.PersistenceChannel.dll</Link> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<IncludeInVSIX>true</IncludeInVSIX> | ||
<VSIXSubPath>.</VSIXSubPath> | ||
</Content> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be conditional for VS versions? |
||
<Content Include="Credits.txt"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
<IncludeInVSIX>true</IncludeInVSIX> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
using Microsoft.NodejsTools.Options; | ||
using Microsoft.NodejsTools.Project; | ||
using Microsoft.NodejsTools.Repl; | ||
using Microsoft.NodejsTools.Telemetry; | ||
using Microsoft.VisualStudio; | ||
using Microsoft.VisualStudio.ComponentModelHost; | ||
using Microsoft.VisualStudio.Debugger.Interop; | ||
|
@@ -106,6 +107,7 @@ internal sealed partial class NodejsPackage : CommonPackage { | |
private LanguagePreferences _langPrefs; | ||
internal VsProjectAnalyzer _analyzer; | ||
private NodejsToolsLogger _logger; | ||
private ITelemetryLogger _telemetryLogger; | ||
|
||
/// <summary> | ||
/// Default constructor of the package. | ||
|
@@ -228,7 +230,9 @@ protected override void Initialize() { | |
IntellisenseOptionsPage.AnalysisLogMaximumChanged += IntellisenseOptionsPage_AnalysisLogMaximumChanged; | ||
|
||
InitializeLogging(); | ||
|
||
|
||
InitializeTelemetry(); | ||
|
||
// The variable is inherited by child processes backing Test Explorer, and is used in | ||
// the NTVS test discoverer and test executor to connect back to VS. | ||
Environment.SetEnvironmentVariable(NodejsConstants.NodeToolsProcessIdEnvironmentVariable, Process.GetCurrentProcess().Id.ToString()); | ||
|
@@ -248,6 +252,17 @@ private void InitializeLogging() { | |
_logger.LogEvent(NodejsToolsLogEvent.AnalysisLevel, IntellisenseOptionsPage.AnalysisLevel); | ||
} | ||
|
||
private void InitializeTelemetry() { | ||
if (_telemetryLogger == null) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. null check is unnecessary because it's always null here. |
||
var thisAssembly = typeof(NodejsPackage).Assembly; | ||
|
||
// Get telemetry logger | ||
_telemetryLogger = TelemetrySetup.Instance.GetLogger(thisAssembly); | ||
|
||
TelemetrySetup.Instance.LogPackageLoad(_telemetryLogger, Guid.Parse(Guids.NodejsPackageString), thisAssembly, Application.ProductVersion); | ||
} | ||
} | ||
|
||
public new IComponentModel ComponentModel { | ||
get { | ||
return this.GetComponentModel(); | ||
|
@@ -260,6 +275,12 @@ internal NodejsToolsLogger Logger { | |
} | ||
} | ||
|
||
internal ITelemetryLogger TelemetryLogger { | ||
get { | ||
return _telemetryLogger; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Makes the debugger context available - this enables our debugger when we're installed into | ||
/// a SKU which doesn't support every installed debugger. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//*********************************************************// | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// | ||
// Apache 2.0 License | ||
// | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
// implied. See the License for the specific language governing | ||
// permissions and limitations under the License. | ||
// | ||
//*********************************************************// | ||
|
||
namespace Microsoft.NodejsTools.Telemetry { | ||
/// <summary> | ||
/// Telemetry event names | ||
/// </summary> | ||
public static class TelemetryEvents { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be internal |
||
public const string ProjectImported = "ProjectImported"; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these files are going to be shared across projects, they should be included alongside the Telemetry dlls in Nodejs/Common, and then linked to from the individual projects.