From 2affdf043493662104c3b77ea8ee895ab0be7245 Mon Sep 17 00:00:00 2001 From: Iman Malik Date: Mon, 27 Jun 2022 06:55:23 -0400 Subject: [PATCH 1/8] bump direct version --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index ab67057965..e6511c44de 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,7 +4,7 @@ 3.28.0 3.28.0 preview - 3.28.2 + 3.29.0 1.0.1 1.0.1 preview From b5db72f43d76af0c69c35ed63a8496973dfaeaed Mon Sep 17 00:00:00 2001 From: Iman Malik Date: Mon, 27 Jun 2022 07:17:20 -0400 Subject: [PATCH 2/8] use new Rfc1123DateTimeCache type --- .../src/Authorization/AuthorizationHelper.cs | 6 +++--- .../src/Authorization/AuthorizationTokenProvider.cs | 2 +- .../Authorization/AuthorizationTokenProviderMasterKey.cs | 6 +++--- Microsoft.Azure.Cosmos/src/DocumentClient.cs | 2 +- Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs | 2 +- Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs | 4 ++-- .../Utils/NonPartitionedContainerHelper.cs | 2 +- .../Utils/TestCommon.cs | 2 +- .../Benchmarks/MasterKeyAuthorizationBenchmark.cs | 2 +- .../Mocks/MockDocumentClient.cs | 2 +- .../Authorization/AuthorizationHelperTests.cs | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Authorization/AuthorizationHelper.cs b/Microsoft.Azure.Cosmos/src/Authorization/AuthorizationHelper.cs index 3db0a128a6..1966a63f0f 100644 --- a/Microsoft.Azure.Cosmos/src/Authorization/AuthorizationHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Authorization/AuthorizationHelper.cs @@ -384,7 +384,7 @@ public static void CheckTimeRangeIsCurrent( RMResources.InvalidTokenTimeRange, startDateTime.ToString("r", CultureInfo.InvariantCulture), expiryDateTime.ToString("r", CultureInfo.InvariantCulture), - DateTime.UtcNow.ToString("r", CultureInfo.InvariantCulture)); + Rfc1123DateTimeCache.UtcNow()); DefaultTrace.TraceError(message); @@ -482,7 +482,7 @@ public static int SerializeMessagePayload( throw new UnauthorizedException(RMResources.InvalidDateHeader); } - headers[HttpConstants.HttpHeaders.XDate] = DateTime.UtcNow.ToString("r", CultureInfo.InvariantCulture); + headers[HttpConstants.HttpHeaders.XDate] = Rfc1123DateTimeCache.UtcNow(); xDate = AuthorizationHelper.GetHeaderValue(headers, HttpConstants.HttpHeaders.XDate); } @@ -662,7 +662,7 @@ private static void ValidateInputRequestTime( RMResources.InvalidTokenTimeRange, utcStartTime.ToString("r", CultureInfo.InvariantCulture), DateTime.MaxValue.ToString("r", CultureInfo.InvariantCulture), - DateTime.UtcNow.ToString("r", CultureInfo.InvariantCulture)); + Rfc1123DateTimeCache.UtcNow()); DefaultTrace.TraceError(message); diff --git a/Microsoft.Azure.Cosmos/src/Authorization/AuthorizationTokenProvider.cs b/Microsoft.Azure.Cosmos/src/Authorization/AuthorizationTokenProvider.cs index 3a148c15dd..c9e98c5415 100644 --- a/Microsoft.Azure.Cosmos/src/Authorization/AuthorizationTokenProvider.cs +++ b/Microsoft.Azure.Cosmos/src/Authorization/AuthorizationTokenProvider.cs @@ -19,7 +19,7 @@ public async Task AddSystemAuthorizationHeaderAsync( string verb, string resourceId) { - request.Headers[HttpConstants.HttpHeaders.XDate] = DateTime.UtcNow.ToString("r", CultureInfo.InvariantCulture); + request.Headers[HttpConstants.HttpHeaders.XDate] = Rfc1123DateTimeCache.UtcNow(); request.Headers[HttpConstants.HttpHeaders.Authorization] = (await this.GetUserAuthorizationAsync( resourceId ?? request.ResourceAddress, diff --git a/Microsoft.Azure.Cosmos/src/Authorization/AuthorizationTokenProviderMasterKey.cs b/Microsoft.Azure.Cosmos/src/Authorization/AuthorizationTokenProviderMasterKey.cs index 44fd0cfa71..5e9b871c13 100644 --- a/Microsoft.Azure.Cosmos/src/Authorization/AuthorizationTokenProviderMasterKey.cs +++ b/Microsoft.Azure.Cosmos/src/Authorization/AuthorizationTokenProviderMasterKey.cs @@ -66,7 +66,7 @@ public AuthorizationTokenProviderMasterKey(string authKey) AuthorizationTokenType tokenType) { // this is masterkey authZ - headers[HttpConstants.HttpHeaders.XDate] = DateTime.UtcNow.ToString("r", CultureInfo.InvariantCulture); + headers[HttpConstants.HttpHeaders.XDate] = Rfc1123DateTimeCache.UtcNow(); string authorizationToken = AuthorizationHelper.GenerateKeyAuthorizationSignature( requestVerb, @@ -97,7 +97,7 @@ public override ValueTask GetUserAuthorizationTokenAsync( ITrace trace) { // this is masterkey authZ - headers[HttpConstants.HttpHeaders.XDate] = DateTime.UtcNow.ToString("r", CultureInfo.InvariantCulture); + headers[HttpConstants.HttpHeaders.XDate] = Rfc1123DateTimeCache.UtcNow(); string authorizationToken = AuthorizationHelper.GenerateKeyAuthorizationSignature( requestVerb, @@ -119,7 +119,7 @@ public override ValueTask AddAuthorizationHeaderAsync( string verb, AuthorizationTokenType tokenType) { - string dateTime = DateTime.UtcNow.ToString("r", CultureInfo.InvariantCulture); + string dateTime = Rfc1123DateTimeCache.UtcNow(); headersCollection[HttpConstants.HttpHeaders.XDate] = dateTime; string token = AuthorizationHelper.GenerateKeyAuthorizationSignature( diff --git a/Microsoft.Azure.Cosmos/src/DocumentClient.cs b/Microsoft.Azure.Cosmos/src/DocumentClient.cs index a3b33b33a0..6a9f87680e 100644 --- a/Microsoft.Azure.Cosmos/src/DocumentClient.cs +++ b/Microsoft.Azure.Cosmos/src/DocumentClient.cs @@ -5502,7 +5502,7 @@ private async Task> ExecuteStoredProcedurePrivat AuthorizationTokenType.PrimaryMasterKey, headers)) { - request.Headers[HttpConstants.HttpHeaders.XDate] = DateTime.UtcNow.ToString("r"); + request.Headers[HttpConstants.HttpHeaders.XDate] = Rfc1123DateTimeCache.UtcNow(); if (options?.PartitionKeyRangeId == null) { await this.AddPartitionKeyInformationAsync( diff --git a/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs b/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs index 51553139b4..477060e4a7 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs @@ -178,7 +178,7 @@ private async Task ReadCollectionAsync( AuthorizationTokenType.PrimaryMasterKey, headers)) { - headers.XDate = DateTime.UtcNow.ToString("r"); + headers.XDate = Rfc1123DateTimeCache.UtcNow(); request.RequestContext.ClientRequestStatistics = clientSideRequestStatistics ?? new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow); diff --git a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs index 1e5d6984e5..827cc79f67 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs @@ -485,7 +485,7 @@ private async Task GetMasterAddressesViaGatewayAsync( string resourceTypeToSign = PathsHelper.GetResourcePath(resourceType); - headers.Set(HttpConstants.HttpHeaders.XDate, DateTime.UtcNow.ToString("r", CultureInfo.InvariantCulture)); + headers.Set(HttpConstants.HttpHeaders.XDate, Rfc1123DateTimeCache.UtcNow()); using (ITrace trace = Trace.GetRootTrace(nameof(GetMasterAddressesViaGatewayAsync), TraceComponent.Authorization, TraceLevel.Info)) { string token = await this.tokenProvider.GetUserAuthorizationTokenAsync( @@ -545,7 +545,7 @@ private async Task GetServerAddressesViaGatewayAsync( string resourceTypeToSign = PathsHelper.GetResourcePath(ResourceType.Document); - headers.Set(HttpConstants.HttpHeaders.XDate, DateTime.UtcNow.ToString("r", CultureInfo.InvariantCulture)); + headers.Set(HttpConstants.HttpHeaders.XDate, Rfc1123DateTimeCache.UtcNow()); string token = null; using (ITrace trace = Trace.GetRootTrace(nameof(GetMasterAddressesViaGatewayAsync), TraceComponent.Authorization, TraceLevel.Info)) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/NonPartitionedContainerHelper.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/NonPartitionedContainerHelper.cs index 8eff325839..8748360c9a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/NonPartitionedContainerHelper.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/NonPartitionedContainerHelper.cs @@ -181,7 +181,7 @@ private static string GenerateMasterKeyAuthorizationSignature( private static string GetUtcDateTime() { - return DateTime.UtcNow.ToString("r"); + return Rfc1123DateTimeCache.UtcNow(); } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs index 917cbcd0a7..09c2c76e61 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs @@ -262,7 +262,7 @@ internal static void AddMasterAuthorizationHeader(this HttpClient client, string if (string.IsNullOrEmpty(key)) throw new ArgumentException("key"); if (headers == null) throw new ArgumentNullException("headers"); - string xDate = DateTime.UtcNow.ToString("r"); + string xDate = Rfc1123DateTimeCache.UtcNow(); client.DefaultRequestHeaders.Remove(HttpConstants.HttpHeaders.XDate); client.DefaultRequestHeaders.Add(HttpConstants.HttpHeaders.XDate, xDate); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/MasterKeyAuthorizationBenchmark.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/MasterKeyAuthorizationBenchmark.cs index ceed2928e3..f3cd49b65d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/MasterKeyAuthorizationBenchmark.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/MasterKeyAuthorizationBenchmark.cs @@ -20,7 +20,7 @@ public MasterKeyAuthorizationBenchmark() { this.authKeyHashFunction = new StringHMACSHA256Hash(MockDocumentClient.GenerateRandomKey()); Headers headers = new Headers(); - headers[HttpConstants.HttpHeaders.XDate] = DateTime.UtcNow.ToString("r", CultureInfo.InvariantCulture); + headers[HttpConstants.HttpHeaders.XDate] = Rfc1123DateTimeCache.UtcNow(); this.testHeaders = headers.CosmosMessageHeaders.INameValueCollection; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs index de77eafcd9..7c0346c866 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs @@ -135,7 +135,7 @@ ValueTask ICosmosAuthorizationTokenProvider.GetUserAuthorizationTokenAsy ITrace trace) // unused, use token based upon what is passed in constructor { // this is masterkey authZ - headers[HttpConstants.HttpHeaders.XDate] = DateTime.UtcNow.ToString("r", CultureInfo.InvariantCulture); + headers[HttpConstants.HttpHeaders.XDate] = Rfc1123DateTimeCache.UtcNow(); string authorization = AuthorizationHelper.GenerateKeyAuthorizationSignature( verb: requestVerb, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Authorization/AuthorizationHelperTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Authorization/AuthorizationHelperTests.cs index d8fb29a892..9558f784e7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Authorization/AuthorizationHelperTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Authorization/AuthorizationHelperTests.cs @@ -21,7 +21,7 @@ public class AuthorizationHelperTests public void TestGenerateAuthorizationTokenWithHashCoreDoesNotEncodeUrl() { Mock mockHeaders = new Mock(); - mockHeaders.SetupGet(h => h["x-ms-date"]).Returns(DateTime.UtcNow.ToString("r", CultureInfo.InvariantCulture)); + mockHeaders.SetupGet(h => h["x-ms-date"]).Returns(Rfc1123DateTimeCache.UtcNow()); Mock hashHelperMock = new Mock(); hashHelperMock.Setup( ch => ch.ComputeHash(It.IsAny>())) From 94b9f3822ae64bd5ef9ff0eaf7c6ceb4f736fb1e Mon Sep 17 00:00:00 2001 From: Iman Malik Date: Mon, 27 Jun 2022 08:52:39 -0400 Subject: [PATCH 3/8] add benchmark --- .../Benchmarks/AuthAllocationsBenchmark.cs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/AuthAllocationsBenchmark.cs diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/AuthAllocationsBenchmark.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/AuthAllocationsBenchmark.cs new file mode 100644 index 0000000000..63fa55ed09 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/AuthAllocationsBenchmark.cs @@ -0,0 +1,30 @@ +namespace Microsoft.Azure.Cosmos.Benchmarks +{ + using System; + using BenchmarkDotNet.Attributes; + using System.Collections.Generic; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + + [MemoryDiagnoser] + public class AuthAllocationsBenchmark + { + public AuthAllocationsBenchmark() + { + } + + [Benchmark] + public void DateTimeToString() + { + _ = DateTime.UtcNow.ToString("r"); + } + + [Benchmark] + public void Rfc1123DateTimeCacheUtcNow() + { + _ = Rfc1123DateTimeCache.UtcNow(); + } + + } +} From 4d0c342c6e9dd6e10127e589ff0fa754b777381f Mon Sep 17 00:00:00 2001 From: Iman Malik Date: Thu, 30 Jun 2022 09:49:34 -0400 Subject: [PATCH 4/8] add using and update direct dependency --- Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj | 2 +- .../Benchmarks/AuthAllocationsBenchmark.cs | 1 + .../Authorization/AuthorizationHelperTests.cs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj index 56f802e368..c9bd7da317 100644 --- a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj +++ b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj @@ -116,7 +116,7 @@ - + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/AuthAllocationsBenchmark.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/AuthAllocationsBenchmark.cs index 63fa55ed09..a1915014ff 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/AuthAllocationsBenchmark.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/AuthAllocationsBenchmark.cs @@ -2,6 +2,7 @@ { using System; using BenchmarkDotNet.Attributes; + using Microsoft.Azure.Documents; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Authorization/AuthorizationHelperTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Authorization/AuthorizationHelperTests.cs index 9558f784e7..1c4d19e732 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Authorization/AuthorizationHelperTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Authorization/AuthorizationHelperTests.cs @@ -9,6 +9,7 @@ namespace Microsoft.Azure.Cosmos.Tests.Authorization using System.Globalization; using System.Text; using Microsoft.Azure.Cosmos; + using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Collections; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; From 92373389a507aca8700d9a2090c6c488771132ac Mon Sep 17 00:00:00 2001 From: Iman Malik Date: Thu, 30 Jun 2022 10:41:43 -0400 Subject: [PATCH 5/8] update dependency test + regions list --- Microsoft.Azure.Cosmos/src/Regions.cs | 10 ++++++++++ .../Contracts/DirectContractTests.cs | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Regions.cs b/Microsoft.Azure.Cosmos/src/Regions.cs index 92ee6486d9..dcbec0ab2f 100644 --- a/Microsoft.Azure.Cosmos/src/Regions.cs +++ b/Microsoft.Azure.Cosmos/src/Regions.cs @@ -145,6 +145,16 @@ public static class Regions /// public const string ChinaEast2 = "China East 2"; + /// + /// Name of the Azure China North 3 region in the Azure Cosmos DB service. + /// + public const string ChinaNorth3 = "China North 3"; + + /// + /// Name of the Azure China East 3 region in the Azure Cosmos DB service. + /// + public const string ChinaEast3 = "China East 3"; + /// /// Name of the Azure Korea South region in the Azure Cosmos DB service. /// diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DirectContractTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DirectContractTests.cs index f44e5986ef..2634ea1bc3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DirectContractTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DirectContractTests.cs @@ -107,7 +107,7 @@ public void ProjectPackageDependenciesTest() { "System.Numerics.Vectors", new Version(4, 5, 0) }, { "Newtonsoft.Json", new Version(10, 0, 2) }, { "Microsoft.Bcl.AsyncInterfaces", new Version(1, 0, 0) }, - { "System.Configuration.ConfigurationManager", new Version(4, 7, 0) }, + { "System.Configuration.ConfigurationManager", new Version(6, 0, 0) }, { "System.Memory", new Version(4, 5, 4) }, { "System.Buffers", new Version(4, 5, 1) }, { "System.Runtime.CompilerServices.Unsafe", new Version(4, 6, 0) }, From 9022cdbd5bdf9dc931ebce894a0d8eace2c97818 Mon Sep 17 00:00:00 2001 From: Iman Malik Date: Thu, 30 Jun 2022 10:45:23 -0400 Subject: [PATCH 6/8] fix regions ordering --- Microsoft.Azure.Cosmos/src/Regions.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Regions.cs b/Microsoft.Azure.Cosmos/src/Regions.cs index dcbec0ab2f..64729bd21a 100644 --- a/Microsoft.Azure.Cosmos/src/Regions.cs +++ b/Microsoft.Azure.Cosmos/src/Regions.cs @@ -145,16 +145,6 @@ public static class Regions /// public const string ChinaEast2 = "China East 2"; - /// - /// Name of the Azure China North 3 region in the Azure Cosmos DB service. - /// - public const string ChinaNorth3 = "China North 3"; - - /// - /// Name of the Azure China East 3 region in the Azure Cosmos DB service. - /// - public const string ChinaEast3 = "China East 3"; - /// /// Name of the Azure Korea South region in the Azure Cosmos DB service. /// @@ -326,7 +316,7 @@ public static class Regions public const string JioIndiaWest = "Jio India West"; /// - /// Name of the Azure US SLV region in the Azure Cosmos DB service. + /// Name of the Azure East US SLV region in the Azure Cosmos DB service. /// public const string EastUSSLV = "East US SLV"; @@ -344,5 +334,15 @@ public static class Regions /// Name of the Azure Qatar Central region in the Azure Cosmos DB service. /// public const string QatarCentral = "Qatar Central"; + + /// + /// Name of the Azure China North 3 region in the Azure Cosmos DB service. + /// + public const string ChinaNorth3 = "China North 3"; + + /// + /// Name of the Azure China East 3 region in the Azure Cosmos DB service. + /// + public const string ChinaEast3 = "China East 3"; } } From 6d972154c02bd204d3f316a4105fc49ea3455467 Mon Sep 17 00:00:00 2001 From: Iman Malik Date: Thu, 30 Jun 2022 11:12:28 -0400 Subject: [PATCH 7/8] update contract --- .../Contracts/DotNetSDKAPI.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 3c6fb1a381..734e3656b8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -6314,6 +6314,11 @@ "Attributes": [], "MethodInfo": "System.String ChinaEast2;IsInitOnly:False;IsStatic:True;" }, + "System.String ChinaEast3": { + "Type": "Field", + "Attributes": [], + "MethodInfo": "System.String ChinaEast3;IsInitOnly:False;IsStatic:True;" + }, "System.String ChinaNorth": { "Type": "Field", "Attributes": [], @@ -6324,6 +6329,11 @@ "Attributes": [], "MethodInfo": "System.String ChinaNorth2;IsInitOnly:False;IsStatic:True;" }, + "System.String ChinaNorth3": { + "Type": "Field", + "Attributes": [], + "MethodInfo": "System.String ChinaNorth3;IsInitOnly:False;IsStatic:True;" + }, "System.String EastAsia": { "Type": "Field", "Attributes": [], From 51cfe45e93e38de53e2ec88712889b41f2f4688c Mon Sep 17 00:00:00 2001 From: Iman Malik Date: Fri, 1 Jul 2022 14:48:03 -0400 Subject: [PATCH 8/8] renaming benchmark --- ...llocationsBenchmark.cs => DateTimeAllocationsBenchmark.cs} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/{AuthAllocationsBenchmark.cs => DateTimeAllocationsBenchmark.cs} (86%) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/AuthAllocationsBenchmark.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/DateTimeAllocationsBenchmark.cs similarity index 86% rename from Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/AuthAllocationsBenchmark.cs rename to Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/DateTimeAllocationsBenchmark.cs index a1915014ff..82b386c8f0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/AuthAllocationsBenchmark.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/DateTimeAllocationsBenchmark.cs @@ -9,9 +9,9 @@ using System.Threading.Tasks; [MemoryDiagnoser] - public class AuthAllocationsBenchmark + public class DateTimeAllocationsBenchmark { - public AuthAllocationsBenchmark() + public DateTimeAllocationsBenchmark() { }