Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed Changes to Fix Concurrency Issues #4020

Closed
1 change: 0 additions & 1 deletion Microsoft.Azure.Cosmos.Samples/Tools/CTL/CTLConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ internal CosmosClient CreateCosmosClient()
CosmosClientOptions clientOptions = new CosmosClientOptions()
{
ApplicationName = CTLConfig.UserAgentSuffix,
EnableClientTelemetry = true
};

if (this.UseGatewayMode)
Expand Down
10 changes: 2 additions & 8 deletions Microsoft.Azure.Cosmos.Samples/Tools/CTL/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,7 @@ await scenario.InitializeAsync(
logger: logger);

logger.LogInformation("Initialization completed.");

if(client.ClientOptions.EnableClientTelemetry.GetValueOrDefault()) {
logger.LogInformation("Telemetry is enabled for CTL.");
} else {
logger.LogInformation("Telemetry is disabled for CTL.");
}
logger.LogInformation("Telemetry is disabled for CTL.");

List<Task> tasks = new List<Task>
{
Expand Down Expand Up @@ -150,8 +145,7 @@ await scenario.InitializeAsync(

private static void SetEnvironmentVariables(CTLConfig config)
{
Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, config.TelemetryEndpoint);
Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, config.TelemetryScheduleInSeconds);
Environment.SetEnvironmentVariable("AZURE_COSMOS_REPLICA_VALIDATION_ENABLED", "True");
}

private static IMetricsRoot ConfigureReporting(
Expand Down
12 changes: 1 addition & 11 deletions Microsoft.Azure.Cosmos.Samples/Tools/CTL/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,7 @@ public static void LogDiagnostics(
CosmosDiagnostics cosmosDiagnostics)
{

if (timerContextLatency > config.DiagnosticsThresholdDurationAsTimespan)
{
logger.LogInformation($"{operationName}; LatencyInMs:{timerContextLatency.TotalMilliseconds}; request took more than latency threshold {config.DiagnosticsThresholdDuration}, diagnostics: {cosmosDiagnostics}");
}

CosmosTraceDiagnostics traceDiagnostics = (CosmosTraceDiagnostics)cosmosDiagnostics;
if (traceDiagnostics.IsGoneExceptionHit())
{
logger.LogInformation($"{operationName}; LatencyInMs:{timerContextLatency.TotalMilliseconds}; request contains 410(GoneExceptions), diagnostics:{cosmosDiagnostics}");
return;
}
logger.LogInformation($"{operationName}; LatencyInMs:{timerContextLatency.TotalMilliseconds}; diagnostics: {cosmosDiagnostics}");
}

public static void LogError(
Expand Down
Loading