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

Benchmark: Adds region to configuration options #4478

Merged
merged 7 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ public class BenchmarkConfig
[Option(Required = false, HelpText = "Enable Client Telemetry Feature in SDK. Make sure you enable it from the portal also.")]
public bool EnableTelemetry { get; set; } = false;

[Option(Required = false, HelpText = "List of comma separated preferred regions.")]
public string ApplicationPreferredRegions { get; set; } = null;

internal int GetTaskCount(int containerThroughput)
{
int taskCount = this.DegreeOfParallelism;
Expand Down Expand Up @@ -224,9 +227,14 @@ internal Microsoft.Azure.Cosmos.CosmosClient CreateCosmosClient(string accountKe
{
DisableSendingMetricsToService = !this.EnableTelemetry,
DisableDistributedTracing = !this.EnableDistributedTracing
}
},
};

if(!string.IsNullOrEmpty(this.ApplicationPreferredRegions))
{
clientOptions.ApplicationPreferredRegions = this.ApplicationPreferredRegions.Split(',');
j82w marked this conversation as resolved.
Show resolved Hide resolved
}

if (!string.IsNullOrWhiteSpace(this.ConsistencyLevel))
{
clientOptions.ConsistencyLevel = (Microsoft.Azure.Cosmos.ConsistencyLevel)Enum.Parse(typeof(Microsoft.Azure.Cosmos.ConsistencyLevel), this.ConsistencyLevel, ignoreCase: true);
Expand Down
1 change: 1 addition & 0 deletions Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ Copyright (C) 2019 CosmosBenchmark
--resultskey Key to publish results to
--resultsdatabase Database to publish results to
--resultscontainer Container to publish results to
--applicationpreferredregions List of comma seperated preferred regions
--help Display this help screen.
--version Display version information.
```
Expand Down
Loading