Skip to content

Commit e006fd1

Browse files
author
Liudmila Molkova
authored
Merge pull request #1142 from microsoft/develop
Develop to master 2.10.0
2 parents ac20bbb + dcd64ac commit e006fd1

File tree

25 files changed

+281
-65
lines changed

25 files changed

+281
-65
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
This changelog will be used to generate documentation on [release notes page](http://azure.microsoft.com/documentation/articles/app-insights-release-notes-dotnet/).
44

5+
## Version 2.10.0
6+
- [SDKVersion modified to be dotnetc for NetCore. This helps identify the source of code path, as implementations are slightly different for NetCore.](https://github.com/microsoft/ApplicationInsights-dotnet/pull/1125)
7+
- [Fix telemetry timestamp precision on .NET Framework](https://github.com/microsoft/ApplicationInsights-dotnet-server/issues/1175)
8+
- [Fix: catch SecurityException when ApplicationInsights config is read in partial trust](https://github.com/microsoft/ApplicationInsights-dotnet/pull/1119)
9+
510
## Version 2.10.0-beta4
611
- [Fix NullReferenceException in DiagnosticsEventListener.OnEventWritten](https://github.com/Microsoft/ApplicationInsights-dotnet/issues/1106)
712
- [Fix RichPayloadEventSource can get enabled at Verbose level](https://github.com/Microsoft/ApplicationInsights-dotnet/issues/1108)

GlobalStaticVersion.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<SemanticVersionMinor>10</SemanticVersionMinor>
1010
<SemanticVersionPatch>0</SemanticVersionPatch>
1111
<!--Valid values: beta1, beta2, EMPTY for stable -->
12-
<PreReleaseMilestone>beta4</PreReleaseMilestone>
12+
<PreReleaseMilestone></PreReleaseMilestone>
1313
<!--
1414
Date when Semantic Version was changed.
1515
Update for every public release.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
![Build Status](https://mseng.visualstudio.com/DefaultCollection/_apis/public/build/definitions/96a62c4a-58c2-4dbb-94b6-5979ebc7f2af/1822/badge)
1+
[![Build Status](https://mseng.visualstudio.com/AppInsights/_apis/build/status/ChuckNorris/AI-BaseSDK-develop-linux?branchName=develop)](https://mseng.visualstudio.com/AppInsights/_build/latest?definitionId=6237?branchName=develop)
2+
[![Build Status](https://mseng.visualstudio.com/AppInsights/_apis/build/status/ChuckNorris/AI-BaseSDK-GitHub-Master?branchName=develop)](https://mseng.visualstudio.com/AppInsights/_build/latest?definitionId=1822?branchName=develop)
23
[![codecov.io](https://codecov.io/github/Microsoft/ApplicationInsights-dotnet/coverage.svg?branch=develop)](https://codecov.io/github/Microsoft/ApplicationInsights-dotnet?branch=develop)
34

45
## NuGet packages
@@ -77,7 +78,7 @@ Application Insights SDK defines the following layers: data collection, public A
7778

7879
**Data reduction pipeline** is a linked list of telemetry processors. Each telemetry processor may decide to pre-aggregate and filter telemetry item or pass it to the next processor. This way only interesting telemetry reaches to the end of the pipeline and being send to the telemetry sinks.
7980

80-
Each **Telemetry sink** is responsible to upload telemetry to the specific back-end. Default telemetry sink sends data to the Application Insights. Sinks may also differ in guarantees they provide while uploading to the same back end. One may implement reliable delivery with re-tries and persistance when another may implement send and forget type of upload. Every telemetry sink may have it's own pipeline for additional data filtering and pre-aggregation.
81+
Each **Telemetry sink** is responsible to upload telemetry to the specific back-end. Default telemetry sink sends data to the Application Insights. Sinks may also differ in guarantees they provide while uploading to the same back end. One may implement reliable delivery with re-tries and persistence when another may implement send and forget type of upload. Every telemetry sink may have it's own pipeline for additional data filtering and pre-aggregation.
8182

8283
Set of telemetry initializers called synchronously for every telemetry item. So extra properties can be added to the item.
8384
By this time telemetry item is fully initialized. Build pipeline to aggregate or filter telemetry.

Test/Microsoft.ApplicationInsights.Test/Net45/Microsoft.ApplicationInsights.Net45.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
<ProjectReference Include="..\..\..\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj" />
2727
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="2.0.30" />
2828
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
29-
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="15.9.0" />
30-
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
31-
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
32-
<PackageReference Include="CompareNETObjects" Version="3.12.0" />
29+
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.1.0" />
30+
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
31+
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
32+
<PackageReference Include="CompareNETObjects" Version="4.59.0" />
3333
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
3434
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" />
35-
<PackageReference Include="Moq" Version="4.8.2" />
35+
<PackageReference Include="Moq" Version="4.10.0" />
3636
<Reference Include="Microsoft.CSharp" />
3737
<Reference Include="System" />
3838
<Reference Include="System.Management" />

Test/Microsoft.ApplicationInsights.Test/Net46/Microsoft.ApplicationInsights.Net46.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626
<ProjectReference Include="..\..\..\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj" />
2727
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="2.0.30" />
2828
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
29-
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="15.9.0" />
30-
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
31-
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
32-
<PackageReference Include="CompareNETObjects" Version="3.12.0" />
29+
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.1.0" />
30+
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
31+
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
32+
<PackageReference Include="CompareNETObjects" Version="4.59.0" />
3333
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
3434
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" />
35-
<PackageReference Include="Moq" Version="4.8.2" />
35+
<PackageReference Include="Moq" Version="4.10.0" />
3636
<Reference Include="Microsoft.CSharp" />
3737
<Reference Include="System" />
3838
<Reference Include="System.Management" />

Test/Microsoft.ApplicationInsights.Test/Shared/Metrics/TestUtility/TestUtil.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,11 @@ public static void ValidateSdkVersionString(string versionMoniker)
236236
Assert.IsNotNull(versionMoniker);
237237

238238
// Expected result example: "m-agg2:2.6.0-12552"
239-
239+
#if NETCOREAPP1_1 || NETCOREAPP2_0
240+
const string expectedPrefix = "m-agg2c:";
241+
#else
240242
const string expectedPrefix = "m-agg2:";
243+
#endif
241244

242245
string sdkRevisionComponentStr = versionMoniker.Substring(expectedPrefix.Length);
243246
string expectedVersion = SdkVersionUtils.GetSdkVersion(String.Empty);

Test/Microsoft.ApplicationInsights.Test/Shared/OperationTelemetryExtensionsTests.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,37 @@ public void OperationTelemetryStopAssignsCurrentTimeAsStartTimeAndTimeStampWitho
6464
Assert.AreEqual(telemetry.Duration, TimeSpan.Zero);
6565
}
6666

67+
#if !NETCOREAPP1_1
68+
/// <summary>
69+
/// Tests the scenario if Start assigns current *precise* time to start time.
70+
/// </summary>
71+
[TestMethod]
72+
public void StartTimeIsPrecise()
73+
{
74+
double [] timeStampDiff = new double[1000];
75+
DateTimeOffset prevTimestamp = DateTimeOffset.MinValue;
76+
for (int i = 0; i < timeStampDiff.Length; i ++)
77+
{
78+
var telemetry = new DependencyTelemetry();
79+
telemetry.Start();
80+
81+
if (i > 0)
82+
{
83+
timeStampDiff[i] = telemetry.Timestamp.Subtract(prevTimestamp).TotalMilliseconds;
84+
Debug.WriteLine(timeStampDiff[i]);
85+
86+
// if timestamp is NOT precise, we'll get precisely 0 which should not ever happen
87+
Assert.IsTrue(timeStampDiff[i] != 0);
88+
}
89+
90+
prevTimestamp = telemetry.Timestamp;
91+
92+
// waste a bit of time, assert result to prevent any optimizations
93+
Assert.IsTrue(ComputeSomethingHeavy() > 0);
94+
}
95+
}
96+
#endif
97+
6798
/// <summary>
6899
/// Tests the scenario if Stop computes the duration of the telemetry when timestamps are supplied to Start and Stop.
69100
/// </summary>
@@ -129,5 +160,17 @@ public void OperationTelemetryCanRecordPreciseDurations()
129160
Assert.IsTrue(difference.Ticks < 10);
130161
}
131162
}
163+
164+
private double ComputeSomethingHeavy()
165+
{
166+
var random = new Random();
167+
double res = 0;
168+
for (int i = 0; i < 10000; i++)
169+
{
170+
res += Math.Sqrt(random.NextDouble());
171+
}
172+
173+
return res;
174+
}
132175
}
133176
}

Test/Microsoft.ApplicationInsights.Test/Shared/TelemetryClientTest.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,37 @@ public void InitializeSetsDateTime()
106106
Assert.IsTrue(telemetry.Timestamp != default(DateTimeOffset));
107107
}
108108

109+
#if !NETCOREAPP1_1
110+
/// <summary>
111+
/// Tests the scenario if Initialize assigns current precise time to start time.
112+
/// </summary>
113+
[TestMethod]
114+
public void TimestampIsPrecise()
115+
{
116+
double[] timeStampDiff = new double[1000];
117+
DateTimeOffset prevTimestamp = DateTimeOffset.MinValue;
118+
for (int i = 0; i < timeStampDiff.Length; i++)
119+
{
120+
var telemetry = new DependencyTelemetry();
121+
new TelemetryClient().Initialize(telemetry);
122+
123+
if (i > 0)
124+
{
125+
timeStampDiff[i] = telemetry.Timestamp.Subtract(prevTimestamp).TotalMilliseconds;
126+
Debug.WriteLine(timeStampDiff[i]);
127+
128+
// if timestamp is NOT precise, we'll get precisely 0 which should not ever happen
129+
Assert.IsTrue(timeStampDiff[i] != 0);
130+
}
131+
132+
prevTimestamp = telemetry.Timestamp;
133+
134+
// waste a bit of time, assert result to prevent any optimizations
135+
Assert.IsTrue(ComputeSomethingHeavy() > 0);
136+
}
137+
}
138+
#endif
139+
109140
[TestMethod]
110141
public void InitializeSetsRoleInstance()
111142
{
@@ -2105,5 +2136,17 @@ private void ClearActiveTelemetryConfiguration()
21052136
{
21062137
TelemetryConfiguration.Active = null;
21072138
}
2139+
2140+
private double ComputeSomethingHeavy()
2141+
{
2142+
var random = new Random();
2143+
double res = 0;
2144+
for (int i = 0; i < 10000; i++)
2145+
{
2146+
res += Math.Sqrt(random.NextDouble());
2147+
}
2148+
2149+
return res;
2150+
}
21082151
}
21092152
}

Test/Microsoft.ApplicationInsights.Test/Standalone/Microsoft.ApplicationInsights.Isolated.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
<Reference Include="System" />
3131

3232
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
33-
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="15.9.0" />
34-
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
35-
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
33+
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.1.0" />
34+
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
35+
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
3636
<PackageReference Include="System.Collections.Immutable" Version="1.3.1" />
3737
<Reference Include="System.ComponentModel.Composition" />
3838
<PackageReference Include="System.Console" Version="4.3.0" />

Test/Microsoft.ApplicationInsights.Test/netcoreapp11/Microsoft.ApplicationInsights.netcoreapp11.Tests.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@
1212
<TargetFrameworks>netcoreapp1.1</TargetFrameworks>
1313
<DebugType>pdbonly</DebugType>
1414
<DebugSymbols>true</DebugSymbols>
15-
<DefineConstants>$(DefineConstants);NETCOREAPP</DefineConstants>
16-
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
15+
<DefineConstants>$(DefineConstants);NETCOREAPP;NETCOREAPP1_1</DefineConstants>
16+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1717
</PropertyGroup>
1818

1919
<ItemGroup>
2020
<ProjectReference Include="..\..\..\src\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj" />
2121
<ProjectReference Include="..\..\..\Test\Microsoft.ApplicationInsights.Test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj" />
2222
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
23-
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="15.9.0" />
24-
<PackageReference Include="Moq" Version="4.8.2" />
25-
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
26-
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
27-
<PackageReference Include="CompareNETObjects" Version="4.0.0" />
23+
<PackageReference Include="Microsoft.TestPlatform.TestHost" Version="16.1.0" />
24+
<PackageReference Include="Moq" Version="4.10.0" />
25+
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
26+
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
27+
<PackageReference Include="CompareNETObjects" Version="4.59.0" />
2828
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
2929
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" />
3030
</ItemGroup>

0 commit comments

Comments
 (0)