diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs index 8edcadd97c..bc90af33f3 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs @@ -352,7 +352,7 @@ internal void CollectOperationInfo(CosmosDiagnostics cosmosDiagnostics, /// private void RecordRntbdResponses(string containerId, string databaseId, List storeResponseStatistics, out int droppedRntbdRequestCount) { - using IClientTelemetrySampler networkRequestSampler + IClientTelemetrySampler networkRequestSampler = new NetworkRequestSampler(ClientTelemetryOptions.NetworkTelemetrySampleSize); droppedRntbdRequestCount = 0; diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/Sampler/IClientTelemetrySampler.cs b/Microsoft.Azure.Cosmos/src/Telemetry/Sampler/IClientTelemetrySampler.cs index c2b5d7483c..bd4d11ac80 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/Sampler/IClientTelemetrySampler.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/Sampler/IClientTelemetrySampler.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.Cosmos.Telemetry.Sampler { using System; - internal interface IClientTelemetrySampler : IDisposable + internal interface IClientTelemetrySampler { internal bool ShouldSample(T statisticsObj); } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/Sampler/NetworkRequestSampler.cs b/Microsoft.Azure.Cosmos/src/Telemetry/Sampler/NetworkRequestSampler.cs index 70295224a2..3fc0b32ad9 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/Sampler/NetworkRequestSampler.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/Sampler/NetworkRequestSampler.cs @@ -66,10 +66,5 @@ private static bool IsStatusCodeNotExcluded(int statusCode, int subStatusCode) { return !(ClientTelemetryOptions.ExcludedStatusCodes.Contains(statusCode) && subStatusCode == 0); } - - public void Dispose() - { - this.TempStorage.Clear(); - } } }