From 2dd1c05c95c98cc006b66d6772c65b2296995e01 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Sat, 2 Sep 2023 00:38:12 +0530 Subject: [PATCH] compilation charges --- .../Tools/Benchmark/BenchmarkConfig.cs | 2 +- .../ClientTelemetryTestsBase.cs | 10 ++++++++-- .../SynchronizationContextTests.cs | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs index 012843c36a..dccac3b9eb 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs @@ -222,7 +222,7 @@ internal Microsoft.Azure.Cosmos.CosmosClient CreateCosmosClient(string accountKe MaxTcpConnectionsPerEndpoint = this.MaxTcpConnectionsPerEndpoint, CosmosClientTelemetryOptions = new Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions() { - EnableSendingMetricsToService = this.EnableTelemetry, + EnableSendingMetricsToService = this.EnableClientTelemetry, DisableDistributedTracing = !this.EnableDistributedTracing } }; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs index 30c239a036..8fd17669ae 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs @@ -140,7 +140,10 @@ public virtual void TestInitialize() }; this.cosmosClientBuilder = this.GetBuilder() - .WithTelemetryEnabled() + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + EnableSendingMetricsToService = true + }) .WithApplicationPreferredRegions(ClientTelemetryTestsBase.preferredRegionList); } @@ -666,7 +669,10 @@ public virtual async Task CreateItemWithSubStatusCodeTest(ConnectionMode mode) // Replacing originally initialized cosmos Builder with this one with new handler this.cosmosClientBuilder = this.cosmosClientBuilder - .WithTelemetryEnabled() + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + EnableSendingMetricsToService = true + }) .WithHttpClientFactory(() => new HttpClient(httpHandler)); Container container = await this.CreateClientAndContainer( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs index 1c5676a46a..52aba34800 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs @@ -59,7 +59,10 @@ public void VerifySynchronizationContextDoesNotLock(bool withClientTelemetry) { using (CosmosClient client = TestCommon.CreateCosmosClient( customizeClientBuilder: (builder) => builder - .WithTelemetryEnabled() + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions () + { + EnableSendingMetricsToService = withClientTelemetry + }) .WithHttpClientFactory(() => new HttpClient(httpHandler)))) { Cosmos.Database database = client.CreateDatabaseAsync(databaseId).GetAwaiter().GetResult();