From 8b60b002fb701f98cb4504d2d9ae2dda28ff9a9b Mon Sep 17 00:00:00 2001 From: Karthik Tangirala Date: Wed, 9 Mar 2016 10:21:00 -0800 Subject: [PATCH 1/3] Update to generations --- Microsoft.ApplicationInsights.sln | 30 +------- .../Core.NuGet-Beta/Core.NuGet.Beta.csproj | 51 ------------- src/Core/NuGet/Core.NuGet-Beta/Package.nuspec | 71 ------------------- .../NuGet/Core.NuGet-Beta/packages.config | 4 -- src/Core/NuGet/Core/Package.nuspec | 30 +++++++- 5 files changed, 29 insertions(+), 157 deletions(-) delete mode 100644 src/Core/NuGet/Core.NuGet-Beta/Core.NuGet.Beta.csproj delete mode 100644 src/Core/NuGet/Core.NuGet-Beta/Package.nuspec delete mode 100644 src/Core/NuGet/Core.NuGet-Beta/packages.config diff --git a/Microsoft.ApplicationInsights.sln b/Microsoft.ApplicationInsights.sln index 8d25147124..59b8cb4d17 100644 --- a/Microsoft.ApplicationInsights.sln +++ b/Microsoft.ApplicationInsights.sln @@ -41,13 +41,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Net45", "src\Core\Mana EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestFramework.Net45", "Test\CoreSDK.Test\TestFramework\Net45\TestFramework.Net45.csproj", "{1AD07F5F-80E4-4020-B944-EE20756E3B24}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.NuGet.Beta", "src\Core\NuGet\Core.NuGet-Beta\Core.NuGet.Beta.csproj", "{4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}" - ProjectSection(ProjectDependencies) = postProject - {862B97AF-F620-43FD-9B65-7E5423F3B7E3} = {862B97AF-F620-43FD-9B65-7E5423F3B7E3} - {412659CA-49B0-4834-BFBF-8183055083C8} = {412659CA-49B0-4834-BFBF-8183055083C8} - {CD752CD2-6711-4AD7-B5C8-F8C23CF076B1} = {CD752CD2-6711-4AD7-B5C8-F8C23CF076B1} - EndProjectSection -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildTools", "src\BuildTools\BuildTools.csproj", "{08B950E4-EBDC-4AD8-8311-746F2E8DEAB2}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Net45.Tests", "Test\CoreSDK.Test\Net45\Core.Net45.Tests.csproj", "{0927E682-4A56-45B6-8125-94FA066B2F57}" @@ -86,8 +79,8 @@ Global Test\CoreSDK.Test\Shared\Core.Shared.Tests.projitems*{394a78e5-2f8f-4d2d-ae08-027380c9f6b2}*SharedItemsImports = 4 Test\CoreSDK.Test\Operation.CC.Shared.Tests\Operation.CC.Tests.Shared.projitems*{394a78e5-2f8f-4d2d-ae08-027380c9f6b2}*SharedItemsImports = 4 Test\CoreSDK.Test\TestFramework\Shared\TestFramework.Shared.projitems*{f76c6cbd-29b0-4564-bdcb-c969f8fec136}*SharedItemsImports = 13 - src\Core\Managed\Operation.AL.Shared\Operation.AL.Shared.projitems*{958cfe53-53b7-4e26-846d-da3f214013e6}*SharedItemsImports = 4 src\Core\Managed\Shared\Shared.projitems*{958cfe53-53b7-4e26-846d-da3f214013e6}*SharedItemsImports = 4 + src\Core\Managed\Operation.AL.Shared\Operation.AL.Shared.projitems*{958cfe53-53b7-4e26-846d-da3f214013e6}*SharedItemsImports = 4 src\Core\Managed\Shared\Shared.projitems*{cd752cd2-6711-4ad7-b5c8-f8c23cf076b1}*SharedItemsImports = 4 src\Core\Managed\Operation.CC.Shared\Operation.CC.Shared.projitems*{cd752cd2-6711-4ad7-b5c8-f8c23cf076b1}*SharedItemsImports = 4 src\Core\Managed\Shared\Shared.projitems*{c1aaa703-5e32-45c0-a69d-f46d1c659ae4}*SharedItemsImports = 13 @@ -210,26 +203,6 @@ Global {1AD07F5F-80E4-4020-B944-EE20756E3B24}.Release|Mixed Platforms.Build.0 = Release|Any CPU {1AD07F5F-80E4-4020-B944-EE20756E3B24}.Release|x64.ActiveCfg = Release|Any CPU {1AD07F5F-80E4-4020-B944-EE20756E3B24}.Release|x86.ActiveCfg = Release|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Debug|ARM.ActiveCfg = Debug|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Debug|ARM.Build.0 = Debug|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Debug|x64.ActiveCfg = Debug|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Debug|x64.Build.0 = Debug|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Debug|x86.ActiveCfg = Debug|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Debug|x86.Build.0 = Debug|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Release|Any CPU.Build.0 = Release|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Release|ARM.ActiveCfg = Release|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Release|ARM.Build.0 = Release|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Release|x64.ActiveCfg = Release|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Release|x64.Build.0 = Release|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Release|x86.ActiveCfg = Release|Any CPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9}.Release|x86.Build.0 = Release|Any CPU {08B950E4-EBDC-4AD8-8311-746F2E8DEAB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {08B950E4-EBDC-4AD8-8311-746F2E8DEAB2}.Debug|Any CPU.Build.0 = Debug|Any CPU {08B950E4-EBDC-4AD8-8311-746F2E8DEAB2}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -364,7 +337,6 @@ Global {862B97AF-F620-43FD-9B65-7E5423F3B7E3} = {68CC2924-E162-44BE-8D7A-DBA385365585} {412659CA-49B0-4834-BFBF-8183055083C8} = {68CC2924-E162-44BE-8D7A-DBA385365585} {1AD07F5F-80E4-4020-B944-EE20756E3B24} = {BED5EB47-4AB1-4387-98B6-83CC327D6D16} - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9} = {05ACA4F0-E560-4E7A-BF50-1C248DAAA0D2} {0927E682-4A56-45B6-8125-94FA066B2F57} = {C2FEEDE5-8CAE-41A4-8932-42D284A86EA7} {958CFE53-53B7-4E26-846D-DA3F214013E6} = {68CC2924-E162-44BE-8D7A-DBA385365585} {0927E682-4A56-46B6-8125-94FA066B2F57} = {C2FEEDE5-8CAE-41A4-8932-42D284A86EA7} diff --git a/src/Core/NuGet/Core.NuGet-Beta/Core.NuGet.Beta.csproj b/src/Core/NuGet/Core.NuGet-Beta/Core.NuGet.Beta.csproj deleted file mode 100644 index 366302d1db..0000000000 --- a/src/Core/NuGet/Core.NuGet-Beta/Core.NuGet.Beta.csproj +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - Debug - AnyCPU - {4D7638A1-2F34-4C6C-BCD2-D0990A4695E9} - Library - $(BinRoot)\$(Configuration)\Core\NuGet\Core - Microsoft.ApplicationInsights.NuGet.Beta - Microsoft.ApplicationInsights.NuGet.Beta - v4.6 - 512 - - 2008 - ..\..\..\..\ - $(MSBuildProjectDirectory)\Package.nuspec - $(BinRoot)\$(Configuration)\Core\Managed\Net40\Microsoft.ApplicationInsights.dll - dad8833d - - - - - - - Designer - - - - - - {412659ca-49b0-4834-bfbf-8183055083c8} - Core.Net45 - - - {958cfe53-53b7-4e26-846d-da3f214013e6} - Core.Net46 - - - - - - - - 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}. - - - - - \ No newline at end of file diff --git a/src/Core/NuGet/Core.NuGet-Beta/Package.nuspec b/src/Core/NuGet/Core.NuGet-Beta/Package.nuspec deleted file mode 100644 index cc367fd415..0000000000 --- a/src/Core/NuGet/Core.NuGet-Beta/Package.nuspec +++ /dev/null @@ -1,71 +0,0 @@ - - - - Microsoft.ApplicationInsights - $version$ - Application Insights API - $author$ - $author$ - http://go.microsoft.com/fwlink/?LinkID=510709 - http://go.microsoft.com/fwlink/?LinkID=510710 - $image$ - true - Application Insights Core API. This package provides core functionality for transmission of all Application Insights Telemetry Types and is a dependent package for all other Application Insights packages. Please install the platform specific package for the best experience. - $copyright$ - For the release notes please follow http://go.microsoft.com/fwlink/?LinkId=535037 - Analytics ApplicationInsights Telemetry AppInsights - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Core/NuGet/Core.NuGet-Beta/packages.config b/src/Core/NuGet/Core.NuGet-Beta/packages.config deleted file mode 100644 index 6e34c13739..0000000000 --- a/src/Core/NuGet/Core.NuGet-Beta/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/Core/NuGet/Core/Package.nuspec b/src/Core/NuGet/Core/Package.nuspec index 7e42aee187..8ec9c457b9 100644 --- a/src/Core/NuGet/Core/Package.nuspec +++ b/src/Core/NuGet/Core/Package.nuspec @@ -23,14 +23,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -42,4 +68,4 @@ - \ No newline at end of file + From 9ab891b9f02f8d3187328ce8356370e494897330 Mon Sep 17 00:00:00 2001 From: Sergey Kanzhelev Date: Thu, 11 Feb 2016 18:13:48 -0800 Subject: [PATCH 2/3] fix performance counters properties --- .../PerformanceCounterTelemetryTest.cs | 10 ++++ .../PerformanceCounterTelemetry.cs | 6 ++- .../Implementation/FixedSizeQueue.cs | 48 ------------------- .../Implementation/TelemetryItemExtensions.cs | 15 ------ src/Core/Managed/Shared/Shared.projitems | 2 - 5 files changed, 14 insertions(+), 67 deletions(-) delete mode 100644 src/Core/Managed/Shared/Extensibility/Implementation/FixedSizeQueue.cs delete mode 100644 src/Core/Managed/Shared/Extensibility/Implementation/TelemetryItemExtensions.cs diff --git a/Test/CoreSDK.Test/Shared/DataContracts/PerformanceCounterTelemetryTest.cs b/Test/CoreSDK.Test/Shared/DataContracts/PerformanceCounterTelemetryTest.cs index 942c24900d..df272254a4 100644 --- a/Test/CoreSDK.Test/Shared/DataContracts/PerformanceCounterTelemetryTest.cs +++ b/Test/CoreSDK.Test/Shared/DataContracts/PerformanceCounterTelemetryTest.cs @@ -20,5 +20,15 @@ public void SerializeWritesNullValuesAsExpectedByEndpoint() Assert.Equal(2, item.Data.BaseData.Ver); } + + [TestMethod] + public void ContextPropertiesUsedAsTelemetryItemProperties() + { + PerformanceCounterTelemetry item = new PerformanceCounterTelemetry(); + + item.Context.Properties["a"] = "b"; + + Assert.Equal("b", item.Properties["a"]); + } } } diff --git a/src/Core/Managed/Shared/DataContracts/PerformanceCounterTelemetry.cs b/src/Core/Managed/Shared/DataContracts/PerformanceCounterTelemetry.cs index 5529138df2..a9e31ce843 100644 --- a/src/Core/Managed/Shared/DataContracts/PerformanceCounterTelemetry.cs +++ b/src/Core/Managed/Shared/DataContracts/PerformanceCounterTelemetry.cs @@ -24,6 +24,7 @@ public sealed class PerformanceCounterTelemetry : ITelemetry, ISupportProperties public PerformanceCounterTelemetry() { this.Data = new PerformanceCounterData(); + this.context = new TelemetryContext(this.Data.properties, new Dictionary()); } /// @@ -33,7 +34,8 @@ public PerformanceCounterTelemetry() /// Performance counter name. /// Instance name. /// Performance counter value. - public PerformanceCounterTelemetry(string categoryName, string counterName, string instanceName, double value) : this() + public PerformanceCounterTelemetry(string categoryName, string counterName, string instanceName, double value) + : this() { this.CategoryName = categoryName; this.CounterName = counterName; @@ -58,7 +60,7 @@ public TelemetryContext Context { get { - return LazyInitializer.EnsureInitialized(ref this.context); + return this.context; } } diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/FixedSizeQueue.cs b/src/Core/Managed/Shared/Extensibility/Implementation/FixedSizeQueue.cs deleted file mode 100644 index 82bf64cc11..0000000000 --- a/src/Core/Managed/Shared/Extensibility/Implementation/FixedSizeQueue.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// Copyright © Microsoft. All Rights Reserved. -// - -namespace Microsoft.ApplicationInsights.Extensibility.Implementation -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Text; - - /// - /// A light fixed size queue. If Enqueue is called and queue's limit has reached the last item will be removed. - /// This data structure is thread safe. - /// - internal class FixedSizeQueue - { - private readonly int maxSize; - private object queueLockObj = new object(); - private Queue queue = new Queue(); - - internal FixedSizeQueue(int maxSize) - { - this.maxSize = maxSize; - } - - internal void Enqueue(T item) - { - lock (this.queueLockObj) - { - if (this.queue.Count == this.maxSize) - { - this.queue.Dequeue(); - } - - this.queue.Enqueue(item); - } - } - - internal bool Contains(T item) - { - lock (this.queueLockObj) - { - return this.queue.Contains(item); - } - } - } -} diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/TelemetryItemExtensions.cs b/src/Core/Managed/Shared/Extensibility/Implementation/TelemetryItemExtensions.cs deleted file mode 100644 index 4cea867c07..0000000000 --- a/src/Core/Managed/Shared/Extensibility/Implementation/TelemetryItemExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Microsoft.ApplicationInsights.Extensibility.Implementation -{ - using System; - using System.Collections.Generic; - using System.Text; - using Microsoft.ApplicationInsights.Channel; - - internal static class TelemetryItemExtensions - { - internal static string GetTelemetryFullName(this ITelemetry item, string envelopeName) - { - return Constants.TelemetryNamePrefix + item.Context.InstrumentationKey + "|" + envelopeName; - } - } -} diff --git a/src/Core/Managed/Shared/Shared.projitems b/src/Core/Managed/Shared/Shared.projitems index 039186688a..9faa15d757 100644 --- a/src/Core/Managed/Shared/Shared.projitems +++ b/src/Core/Managed/Shared/Shared.projitems @@ -58,7 +58,6 @@ - @@ -78,7 +77,6 @@ - From 9b5b49f2a7697a2bf38f09ca2f2c97326c49d93b Mon Sep 17 00:00:00 2001 From: Anastasia Baranchenkova Date: Wed, 9 Mar 2016 11:50:04 -0800 Subject: [PATCH 3/3] Remove milestone to release stable version --- GlobalStaticVersion.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GlobalStaticVersion.props b/GlobalStaticVersion.props index 4579fd9659..43fb5f187c 100644 --- a/GlobalStaticVersion.props +++ b/GlobalStaticVersion.props @@ -8,7 +8,7 @@ 2 0 0 - rc1 +