From ba2b7d909f529ff7e32f098a3e83bc03498df937 Mon Sep 17 00:00:00 2001 From: Sergey Kanzhelev Date: Fri, 19 Aug 2016 13:24:46 -0700 Subject: [PATCH] properties should support concurrency --- Schema/generateSchema.ps1 | 2 ++ .../Implementation/External/AvailabilityData_types.cs | 7 +++++-- .../Extensibility/Implementation/External/Base_types.cs | 3 +++ .../Implementation/External/ContextTagKeys_types.cs | 3 +++ .../Implementation/External/DataPointType_types.cs | 3 +++ .../Implementation/External/DataPoint_types.cs | 3 +++ .../Extensibility/Implementation/External/Data_types.cs | 3 +++ .../Extensibility/Implementation/External/Domain_types.cs | 3 +++ .../Implementation/External/Envelope_types.cs | 5 ++++- .../Implementation/External/EventData_types.cs | 7 +++++-- .../Implementation/External/ExceptionData_types.cs | 7 +++++-- .../Implementation/External/ExceptionDetails_types.cs | 3 +++ .../Implementation/External/MessageData_types.cs | 5 ++++- .../Implementation/External/MetricData_types.cs | 5 ++++- .../Implementation/External/PageViewData_types.cs | 3 +++ .../Implementation/External/PageViewPerfData_types.cs | 3 +++ .../Implementation/External/RemoteDependencyData_types.cs | 7 +++++-- .../Implementation/External/RequestData_types.cs | 7 +++++-- .../Implementation/External/SeverityLevel_types.cs | 3 +++ .../Implementation/External/StackFrame_types.cs | 3 +++ .../Implementation/External/TestResult_types.cs | 3 +++ 21 files changed, 75 insertions(+), 13 deletions(-) diff --git a/Schema/generateSchema.ps1 b/Schema/generateSchema.ps1 index 198ff6cc7a..f82540770f 100644 --- a/Schema/generateSchema.ps1 +++ b/Schema/generateSchema.ps1 @@ -90,8 +90,10 @@ del "$currentDir\obj\gbc\*_proxies.cs" dir "$currentDir\obj\gbc" | ForEach-Object { # Rename namespace from AI to Microsoft.ApplicationInsights.Extensibility.Implementation.External RegExReplace $_.FullName "(namespace AI)" "namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External" + RegExReplace $_.FullName "new Dictionary" "new ConcurrentDictionary" # Remove "using Bond" statements RegExReplace $_.FullName "using Bond.*" + RegExReplace $_.FullName "using System.Collections.Generic;" "using System.Collections.Concurrent;`r`n using System.Collections.Generic;" # Remove all Bond attributes RegExReplace $_.FullName "\[global::Bond\..*\]" # Remove derivations from Microsoft.Telemetry.Domain diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/AvailabilityData_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/AvailabilityData_types.cs index 9a6c0d5ba6..eb6abe6856 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/AvailabilityData_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/AvailabilityData_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -97,8 +98,8 @@ protected AvailabilityData(string fullName, string name) duration = ""; runLocation = ""; message = ""; - properties = new Dictionary(); - measurements = new Dictionary(); + properties = new ConcurrentDictionary(); + measurements = new ConcurrentDictionary(); } } } // AI @@ -112,3 +113,5 @@ protected AvailabilityData(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/Base_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/Base_types.cs index 93aff14e69..4fb58e420b 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/Base_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/Base_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -58,3 +59,5 @@ protected Base(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/ContextTagKeys_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/ContextTagKeys_types.cs index 423ac4bac5..ccd21e273e 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/ContextTagKeys_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/ContextTagKeys_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -192,3 +193,5 @@ protected ContextTagKeys(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/DataPointType_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/DataPointType_types.cs index a35638e3ec..fb6f906cac 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/DataPointType_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/DataPointType_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -46,3 +47,5 @@ internal enum DataPointType + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/DataPoint_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/DataPoint_types.cs index 1e10f84c2a..41c71a31fe 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/DataPoint_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/DataPoint_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -83,3 +84,5 @@ protected DataPoint(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/Data_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/Data_types.cs index c3fe78c9fe..698b039f02 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/Data_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/Data_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -59,3 +60,5 @@ protected Data(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/Domain_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/Domain_types.cs index aba4591815..97cbc2c081 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/Domain_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/Domain_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -46,3 +47,5 @@ internal partial class Domain + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/Envelope_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/Envelope_types.cs index 0ab01387b3..c5be8b15c5 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/Envelope_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/Envelope_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -94,7 +95,7 @@ protected Envelope(string fullName, string name) sampleRate = 100.0; seq = ""; iKey = ""; - tags = new Dictionary(); + tags = new ConcurrentDictionary(); } } @@ -109,3 +110,5 @@ protected Envelope(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/EventData_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/EventData_types.cs index df9cf8d06c..0328803e80 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/EventData_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/EventData_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -63,8 +64,8 @@ protected EventData(string fullName, string name) { ver = 2; this.name = ""; - properties = new Dictionary(); - measurements = new Dictionary(); + properties = new ConcurrentDictionary(); + measurements = new ConcurrentDictionary(); } } } // AI @@ -78,3 +79,5 @@ protected EventData(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/ExceptionData_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/ExceptionData_types.cs index 8e089ba838..e7c7aef7fb 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/ExceptionData_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/ExceptionData_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -77,8 +78,8 @@ protected ExceptionData(string fullName, string name) handledAt = ""; exceptions = new List(); problemId = ""; - properties = new Dictionary(); - measurements = new Dictionary(); + properties = new ConcurrentDictionary(); + measurements = new ConcurrentDictionary(); } } } // AI @@ -92,3 +93,5 @@ protected ExceptionData(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/ExceptionDetails_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/ExceptionDetails_types.cs index c7bf215eab..04bd127279 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/ExceptionDetails_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/ExceptionDetails_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -88,3 +89,5 @@ protected ExceptionDetails(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/MessageData_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/MessageData_types.cs index c5d0e81808..547abe256b 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/MessageData_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/MessageData_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -61,7 +62,7 @@ protected MessageData(string fullName, string name) { ver = 2; message = ""; - properties = new Dictionary(); + properties = new ConcurrentDictionary(); } } } // AI @@ -75,3 +76,5 @@ protected MessageData(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/MetricData_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/MetricData_types.cs index cc35aec5cf..6a8e778896 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/MetricData_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/MetricData_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -56,7 +57,7 @@ protected MetricData(string fullName, string name) { ver = 2; metrics = new List(); - properties = new Dictionary(); + properties = new ConcurrentDictionary(); } } } // AI @@ -70,3 +71,5 @@ protected MetricData(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/PageViewData_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/PageViewData_types.cs index 4bf2d72bb1..db5c8c01a8 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/PageViewData_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/PageViewData_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -66,3 +67,5 @@ protected PageViewData(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/PageViewPerfData_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/PageViewPerfData_types.cs index 6f067b325f..2bf4436444 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/PageViewPerfData_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/PageViewPerfData_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -84,3 +85,5 @@ protected PageViewPerfData(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/RemoteDependencyData_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/RemoteDependencyData_types.cs index 6ea5c3cc46..4d61496f0d 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/RemoteDependencyData_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/RemoteDependencyData_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -104,8 +105,8 @@ protected RemoteDependencyData(string fullName, string name) dependencyTypeName = ""; target = ""; - properties = new Dictionary(); - measurements = new Dictionary(); + properties = new ConcurrentDictionary(); + measurements = new ConcurrentDictionary(); } } } // AI @@ -119,3 +120,5 @@ protected RemoteDependencyData(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/RequestData_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/RequestData_types.cs index 77689048b6..a9ef09895a 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/RequestData_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/RequestData_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -90,8 +91,8 @@ protected RequestData(string fullName, string name) duration = ""; responseCode = ""; url = ""; - properties = new Dictionary(); - measurements = new Dictionary(); + properties = new ConcurrentDictionary(); + measurements = new ConcurrentDictionary(); } } } // AI @@ -105,3 +106,5 @@ protected RequestData(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/SeverityLevel_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/SeverityLevel_types.cs index 0afb015e0f..d51aee7425 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/SeverityLevel_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/SeverityLevel_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -49,3 +50,5 @@ internal enum SeverityLevel + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/StackFrame_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/StackFrame_types.cs index 0bc4c06976..706b01461f 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/StackFrame_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/StackFrame_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -78,3 +79,5 @@ protected StackFrame(string fullName, string name) + + diff --git a/src/Core/Managed/Shared/Extensibility/Implementation/External/TestResult_types.cs b/src/Core/Managed/Shared/Extensibility/Implementation/External/TestResult_types.cs index 9ca77f6e47..489881f693 100644 --- a/src/Core/Managed/Shared/Extensibility/Implementation/External/TestResult_types.cs +++ b/src/Core/Managed/Shared/Extensibility/Implementation/External/TestResult_types.cs @@ -26,6 +26,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External { + using System.Collections.Concurrent; using System.Collections.Generic; @@ -46,3 +47,5 @@ internal enum TestResult + +