Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
8a3883e
[Internal] Client Telemetry: Fixes tests leaking environment variable…
ealsur Oct 27, 2022
543294c
Updated change log and bumped up the version. (#3526)
kundadebdatta Oct 29, 2022
abf3d93
Query: Fixes performance regression on target partition on some ORDER…
neildsh Oct 31, 2022
84ef545
[Internal] AI Integration: Adds SubStatusCode Information in attribut…
sourabh1007 Nov 2, 2022
68b9805
Diagnostics: Removes unused properties and reduces size (#3519)
aavasthy Nov 2, 2022
a9bcaf5
[Internal] docs: Add address caches conceptual flow (#3534)
kirankumarkolli Nov 2, 2022
6762e07
Release: Adds SDK version and changelog for 3.31.2 (#3546)
neildsh Nov 3, 2022
ef7339e
[Internal] Documentation: Removes invalid comment from ReadThroughput…
ealsur Nov 4, 2022
825595a
[Internal] nugetconfig: Removes specific overrides (#3551)
kirankumarkolli Nov 7, 2022
4746a6f
Query: Fixes partition range evaluation for spatial queries (#3495)
adityasa Nov 9, 2022
acd899e
[Internal] Documentation: Refactors cache content on its own document…
ealsur Nov 9, 2022
01c1cd4
[Internal] Emulator unit tests: Adds IdEncoding unit tests for Comput…
FabianMeiswinkel Nov 10, 2022
ab1f249
Change Feed Processor: Adds support for Resource Tokens (#3566)
ealsur Nov 15, 2022
9fb3a12
[Internal] AI integration: Refactor code how container and database n…
sourabh1007 Nov 15, 2022
9c2015b
[Internal] AI Integration: Adds a new flag in DistributedTracingOptio…
sourabh1007 Nov 16, 2022
c38346d
Query: Fixes default to BadRequestException in case of internal error…
neildsh Nov 17, 2022
9cafaa8
[Internal] Query: Adds unit tests for Merge/Split implementation with…
akotalwar Nov 17, 2022
2681be8
Client Retry Policy: Adds HTTP timeouts with request-level cross-regi…
NaluTripician Nov 18, 2022
010e4ba
Documentation: Fixes EUAP in Comments (#3579)
PramodValavala-MSFT Nov 21, 2022
b24eeb9
Query: Fixes incorrect FeedResponse.Count when result contains undefi…
neildsh Nov 23, 2022
9734ec5
removed allr eference (#3581)
sourabh1007 Nov 24, 2022
6632168
Trace: Fixes Tracing/diagnostics hour-times to 24Hours (#3577)
kirankumarkolli Nov 24, 2022
8e82a1a
AI Integration: Adds cosmetic fixes (#3576)
sourabh1007 Nov 26, 2022
2f047e1
Query: Adds ALL Scalar Expression (#3509)
ezrahaleva-msft Nov 28, 2022
07b34e6
Release: Adds API contracts for 3.31.2-preview (#3586)
neildsh Nov 28, 2022
5318646
[Internal] sccignore: Adds a .sccignore file to apply an exception fo…
vivekr20 Nov 29, 2022
28318b0
[Internal] PermissionTests: Adds CosmosPermissionTests Coverage (#3593)
prasadu-microsoft Dec 1, 2022
a34bac7
[Internal] AI Integration: Refactors to Operation prefix and add test…
sourabh1007 Dec 5, 2022
6b1fa03
[Internal] HttpTimeoutPolicy: Removes Data Plane Writes from being ab…
NaluTripician Dec 15, 2022
814e72e
[Internal] Performance Testing: Adds Distributed Tracing option in be…
sourabh1007 Dec 20, 2022
5c05fbb
[Internal] Benchmark: Refactors code to make Memory Stream capacity c…
sourabh1007 Jan 4, 2023
73c9e08
add new LatestVersion changefeed mode that has same behavior as Incre…
philipthomas-MSFT Jan 4, 2023
77e3aa4
Query: Fixes handling of CosmosUndefined, CosmosGuid and CosmosBinary…
neildsh Jan 7, 2023
3c875c7
[Internal] Subpartitioning: Adds updates to test coverage for subpart…
NaluTripician Jan 9, 2023
416b154
[Internal] ContainerProperties: Fixes version reset when setting Part…
ealsur Jan 9, 2023
59b70a6
[Internal] AI Integration: Adds CorrelationId and Activity Id Attribu…
sourabh1007 Jan 10, 2023
612337c
Documentation: Fixes CosmosClientBuilder.WithConnectionModeGateway pa…
arthuraugsten Jan 11, 2023
55f9ce8
Upgrade Resiliency: Refactors Implementation for Opening Rntbd Connec…
kundadebdatta Jan 11, 2023
8495cf6
Code changes to implement replica validation in dotnet v3 sdk.
kundadebdatta Jan 5, 2023
39ac067
Cosmetic changes to add inline code comments.
kundadebdatta Jan 12, 2023
9dde99e
[Preview] AI integration: Adds IsDistributedTracingEnabled flag as pu…
sourabh1007 Jan 12, 2023
3b7ca27
Code chages to address review comments.
kundadebdatta Jan 13, 2023
36d0e0f
Change Feed Processor: Fixes behavior with StartTime on Local (#3645)
ealsur Jan 13, 2023
4a11e6a
Code changes to cover a scenario for async cache.
kundadebdatta Jan 13, 2023
bdd059d
[Internal] Client Telemetry: Refactors code to use base useragent str…
sourabh1007 Jan 17, 2023
b3cf7df
[Internal] AI Integration: Refactors code to rename event name (#3648)
sourabh1007 Jan 17, 2023
b2541ec
Code changes to refactor async non-blocking cache code.
kundadebdatta Jan 17, 2023
4b77519
Region Availability: Adds Poland Central Region For Public Usage (#3656)
kundadebdatta Jan 17, 2023
3ad6562
Merge branch 'master' into users/kundadebdatta/3548_replica_validatio…
kundadebdatta Jan 17, 2023
1710115
Client Encryption: Adds validation code to check if the Key Vault URI…
kr-santosh Jan 19, 2023
e383d83
[Internal] Query: Adds Split Support for Ode (#3572)
akotalwar Jan 20, 2023
ccaf8fb
[Internal] AI Integration : Fixes operation type for batch (#3660)
sourabh1007 Jan 23, 2023
c29abfe
CosmosClientOptions: Adds ServerCertificateCustomValidationCallback f…
aavasthy Jan 24, 2023
2608d4a
Query: Adds EnableOptimisticDirectExecution flag to QueryRequestOptio…
akotalwar Jan 26, 2023
d6a439f
[Internal] Tests: Removes Direct/HTTPS emulator tests (#3679)
ealsur Feb 2, 2023
393ae23
[Internal] Benchmark : Fixes issue with dependency on Cosmos Project …
sourabh1007 Feb 2, 2023
122bc56
LocalQuorum: Adds Quorum reads on Consistent Prefix Accounts (#3680)
pravengithub Feb 3, 2023
8a537ce
3.32.0: Adds new SDK version and contract files (#3687)
aavasthy Feb 6, 2023
bf9a6d4
[Internal] Samples: Adds change feed pull model samples (#3646)
jcocchi Feb 9, 2023
16caa1b
[Internal] Tests: Refactors emulator CI (#3688)
ealsur Feb 13, 2023
6434c10
[Internal] GitHub Template: Adds needs-investigation label (#3708)
ealsur Feb 14, 2023
4e923da
Adding fabric bot action (#3709)
ealsur Feb 14, 2023
38d1bcc
CosmosNullReferenceException: Refactors CosmosNullReferenceException …
jeet1995 Feb 17, 2023
209e473
[Internal] PriorityRequests: Fixes header value (#3714)
Achint-Agrawal Feb 17, 2023
67e1a90
[Internal] Query: Adds single physical partition check for Optimistic…
akotalwar Feb 17, 2023
b257f8e
[Internal] CTL: Fixes Reservoir Sampling Logic (#3712)
kundadebdatta Feb 17, 2023
05fe30f
Merge branch 'master' into msdata/direct
kundadebdatta Feb 24, 2023
421e07a
Merge branch 'users/kundadebdatta/3548_replica_validation_v3_changes'…
kundadebdatta Feb 24, 2023
e30dc38
Code changes to port latest direct and v3 master changes.
kundadebdatta Feb 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
labels: needs-investigation
assignees: ''

---
Expand Down
56 changes: 54 additions & 2 deletions .github/fabricbot.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"capabilityId": "ScheduledSearch",
"subCapability": "ScheduledSearch",
"version": "1.1",
"id": "a-PNOJWK3Jbr7QY7vkc2O",
"config": {
"frequency": [
{
Expand Down Expand Up @@ -50,7 +49,60 @@
]
},
"disabled": true
},
{
"taskType": "trigger",
"capabilityId": "IssueResponder",
"subCapability": "IssuesOnlyResponder",
"version": "1.0",
"config": {
"conditions": {
"operator": "and",
"operands": [
{
"operator": "not",
"operands": [
{
"name": "isAssignedToSomeone",
"parameters": {}
}
]
},
{
"name": "isAction",
"parameters": {
"action": "opened"
}
},
{
"operator": "not",
"operands": [
{
"name": "hasLabel",
"parameters": {
"label": "needs-investigation"
}
}
]
}
]
},
"eventType": "issue",
"eventNames": [
"issues",
"project_card"
],
"taskName": "Add needs-investigation",
"actions": [
{
"name": "addLabel",
"parameters": {
"label": "needs-investigation"
}
}
]
}
}
],
"userGroups": []
}
}
3 changes: 3 additions & 0 deletions .sscignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cfs" : ["CFS0011"]
}
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ Or all through `Re-run failed checks` on the top right corner:

![Re-run all failures](docs/images/contributing-rerunall.png)

## Usage of Cosmos DB Emulator for running unit tests

- - The same version of the emulator used in the CI pipelines can be downloaded [here](https://aka.ms/cosmosdb-emulator)
- More information about how ro use the emulator for development is documented [here](https://github.com/Azure/azure-documentdb-dotnet/blob/master/docs/documentdb-nosql-local-emulator.md)
- You can start the emulator with same parameters as the emulator unit tests in the CI pipeline via `.\CosmosDB.Emulator.exe /DisableRateLimiting /PartitionCount=100 /Consistency=Strong /enableRio /EnablePreview /EnableAadAuthentication /EnableSqlComputeEndpoint`

## Troubleshooting

- [General .NET SDK Troubleshooting](https://docs.microsoft.com/azure/cosmos-db/sql/troubleshoot-dot-net-sdk)
Expand Down
11 changes: 5 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ClientOfficialVersion>3.31.0</ClientOfficialVersion>
<ClientPreviewVersion>3.31.0</ClientPreviewVersion>
<ClientOfficialVersion>3.32.0</ClientOfficialVersion>
<ClientPreviewVersion>3.32.0</ClientPreviewVersion>
<ClientPreviewSuffixVersion>preview</ClientPreviewSuffixVersion>
<DirectVersion>3.29.2</DirectVersion>
<EncryptionOfficialVersion>2.0.0</EncryptionOfficialVersion>
<EncryptionPreviewVersion>2.0.0</EncryptionPreviewVersion>
<DirectVersion>3.30.2</DirectVersion>
<EncryptionOfficialVersion>2.0.1</EncryptionOfficialVersion>
<EncryptionPreviewVersion>2.0.1</EncryptionPreviewVersion>
<EncryptionPreviewSuffixVersion>preview</EncryptionPreviewSuffixVersion>
<CustomEncryptionVersion>1.0.0-preview04</CustomEncryptionVersion>
<HybridRowVersion>1.1.0-preview3</HybridRowVersion>
Expand Down
10 changes: 10 additions & 0 deletions Microsoft.Azure.Cosmos.Encryption/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ Preview features are treated as a separate branch and will not be included in th
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### <a name="2.0.1"/> [2.0.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.1) - 2023-03-11

#### Added
- [#3642](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3642) Adds validation code to check if the Key Vault URI provided in wrap metadata is a valid key identifier.

### <a name="2.0.1-preview"/> [2.0.1-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.1-preview) - 2023-01-11

#### Added
- [#3642](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3642) Adds validation code to check if the Key Vault URI provided in wrap metadata is a valid key identifier.

### <a name="2.0.0"/> [2.0.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.0) - 2022-06-28

#### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ public static async Task<ClientEncryptionKeyResponse> CreateClientEncryptionKeyA
+ " Please refer to https://aka.ms/CosmosClientEncryption for more details.");
}

if (string.Equals(encryptionCosmosClient.KeyEncryptionKeyResolverName, KeyEncryptionKeyResolverName.AzureKeyVault))
{
// https://KEYVAULTNAME.vault.azure.net/keys/KEYNAME/KEYVERSION
string[] keyVaultUriSegments = new Uri(encryptionKeyWrapMetadata.Value).Segments;

if (keyVaultUriSegments.Length != 4 || !string.Equals(keyVaultUriSegments[1], "keys/", StringComparison.InvariantCultureIgnoreCase))
{
throw new ArgumentException($"Invalid Key Vault URI'{encryptionKeyWrapMetadata.Value}' passed. Pass the complete Azure keyvault key identifier. Please refer to https://aka.ms/CosmosClientEncryption for more details.");
}
}

KeyEncryptionKey keyEncryptionKey = KeyEncryptionKey.GetOrCreate(
encryptionKeyWrapMetadata.Name,
encryptionKeyWrapMetadata.Value,
Expand Down Expand Up @@ -192,6 +203,17 @@ public static async Task<ClientEncryptionKeyResponse> RewrapClientEncryptionKeyA
+ " Please refer to https://aka.ms/CosmosClientEncryption for more details.");
}

if (string.Equals(encryptionCosmosClient.KeyEncryptionKeyResolverName, KeyEncryptionKeyResolverName.AzureKeyVault))
{
// https://KEYVAULTNAME.vault.azure.net/keys/KEYNAME/KEYVERSION
string[] keyVaultUriSegments = new Uri(newEncryptionKeyWrapMetadata.Value).Segments;

if (keyVaultUriSegments.Length != 4 || !string.Equals(keyVaultUriSegments[1], "keys/", StringComparison.InvariantCultureIgnoreCase))
{
throw new ArgumentException($"Invalid Key Vault URI'{newEncryptionKeyWrapMetadata.Value}' passed. Pass the complete Azure keyvault key identifier. Please refer to https://aka.ms/CosmosClientEncryption for more details.");
}
}

ClientEncryptionKeyProperties clientEncryptionKeyProperties = await clientEncryptionKey.ReadAsync(cancellationToken: cancellationToken);

RequestOptions requestOptions = new RequestOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
</ItemGroup>

<ItemGroup Condition=" '$(SdkProjectRef)' != 'True' AND '$(IsPreview)' != 'True' ">
<PackageReference Include="Microsoft.Azure.Cosmos" Version="[3.28.0,3.29)" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="[3.31.0,3.32)" />
</ItemGroup>

<ItemGroup Condition=" '$(SdkProjectRef)' != 'True' AND '$(IsPreview)' == 'True' ">
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.28.0-preview" />
<PackageReference Include="Microsoft.Azure.Cosmos" Version="3.31.2-preview" />
</ItemGroup>

<ItemGroup Condition=" '$(SdkProjectRef)' == 'True' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,69 @@ await MdeEncryptionTests.CreateClientEncryptionKeyAsync(
if (ex is CosmosException cosmosException)
Assert.AreEqual(HttpStatusCode.Conflict, cosmosException.StatusCode);
}

cekId = "testAkvKid";
CosmosClient client = TestCommon.CreateCosmosClient();
TestKeyEncryptionKeyResolver testKeyEncryptionKeyResolver = new TestKeyEncryptionKeyResolver();

EncryptionKeyWrapMetadata metadata = MdeEncryptionTests.CreateEncryptionKeyWrapMetadata(KeyEncryptionKeyResolverName.AzureKeyVault, "key1", "https://testkeyvault.vault.azure.net/keys/testkey/12345678");

CosmosClient encryptionCosmosClient = client.WithEncryption(
testKeyEncryptionKeyResolver,
KeyEncryptionKeyResolverName.AzureKeyVault,
TimeSpan.Zero);

Database database = await encryptionCosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString());

ClientEncryptionKeyResponse clientEncrytionKeyResponse = await database.CreateClientEncryptionKeyAsync(
cekId,
DataEncryptionAlgorithm.AeadAes256CbcHmacSha256,
metadata);

Assert.AreEqual(HttpStatusCode.Created, clientEncrytionKeyResponse.StatusCode);

metadata = MdeEncryptionTests.CreateEncryptionKeyWrapMetadata(KeyEncryptionKeyResolverName.AzureKeyVault, "key1", "https://testkeyvault.vault.azure.net/keys/testkey/9101112");

clientEncrytionKeyResponse = await database.RewrapClientEncryptionKeyAsync(
cekId,
metadata);

Assert.AreEqual(HttpStatusCode.OK, clientEncrytionKeyResponse.StatusCode);

// complete key identifier not passed
metadata = MdeEncryptionTests.CreateEncryptionKeyWrapMetadata(KeyEncryptionKeyResolverName.AzureKeyVault, "key1", "https://testkeyvault.vault.azure.net/keys/testkey");

try
{
clientEncrytionKeyResponse = await database.CreateClientEncryptionKeyAsync(
cekId,
DataEncryptionAlgorithm.AeadAes256CbcHmacSha256,
metadata);

Assert.Fail("Key creation should have failed.");

}
catch(Exception ex)
{
Assert.AreEqual(true, ex.Message.Contains("Invalid Key Vault URI"));
}

// rewrap old key with new key vault uri without complete key identifier
try
{
clientEncrytionKeyResponse = await database.RewrapClientEncryptionKeyAsync(
cekId,
metadata);

Assert.Fail("Key rewrap should have failed.");

}
catch (Exception ex)
{
Assert.AreEqual(true, ex.Message.Contains("Invalid Key Vault URI"));
}

encryptionCosmosClient.Dispose();
}

[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ public class BenchmarkConfig
[Option(Required = false, HelpText = "Enable Client Telemetry")]
public bool EnableTelemetry { get; set; }

[Option(Required = false, HelpText = "Enable Distributed Tracing")]
public bool EnableDistributedTracing { get; set; }

[Option(Required = false, HelpText = "Client Telemetry Schedule in Seconds")]
public int TelemetryScheduleInSec { get; set; }

Expand Down Expand Up @@ -140,7 +143,9 @@ internal void Print()
Utility.TeeTraceInformation($"{nameof(BenchmarkConfig)} arguments");
Utility.TeeTraceInformation($"IsServerGC: {GCSettings.IsServerGC}");
Utility.TeeTraceInformation("--------------------------------------------------------------------- ");
Utility.TeeTraceInformation(JsonHelper.ToString(this));
Utility.TeeTraceInformation(JsonHelper.ToString(
input: this,
capacity: 2048));
Utility.TeeTraceInformation("--------------------------------------------------------------------- ");
Utility.TeeTraceInformation(string.Empty);
}
Expand Down Expand Up @@ -219,6 +224,8 @@ internal Microsoft.Azure.Cosmos.CosmosClient CreateCosmosClient(string accountKe
clientOptions.ConsistencyLevel = (Microsoft.Azure.Cosmos.ConsistencyLevel)Enum.Parse(typeof(Microsoft.Azure.Cosmos.ConsistencyLevel), this.ConsistencyLevel, ignoreCase: true);
}

clientOptions.IsDistributedTracingEnabled = this.EnableDistributedTracing;

return new Microsoft.Azure.Cosmos.CosmosClient(
this.EndPoint,
accountKey,
Expand Down
12 changes: 6 additions & 6 deletions Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/JsonHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ internal static class JsonHelper
});
private const int DefaultCapacity = 1024;

public static string ToString<T>(T input)
public static string ToString<T>(T input, int capacity = JsonHelper.DefaultCapacity)
{
using (MemoryStream stream = JsonHelper.ToStream(input))
using (MemoryStream stream = JsonHelper.ToStream(input, capacity))
using (StreamReader sr = new StreamReader(stream))
{
return sr.ReadToEnd();
Expand All @@ -31,15 +31,15 @@ public static T Deserialize<T>(string payload)
return JsonConvert.DeserializeObject<T>(payload);
}

public static MemoryStream ToStream<T>(T input)
public static MemoryStream ToStream<T>(T input, int capacity = JsonHelper.DefaultCapacity)
{
byte[] blob = System.Buffers.ArrayPool<byte>.Shared.Rent(JsonHelper.DefaultCapacity);
MemoryStream memStreamPayload = new MemoryStream(blob, 0, JsonHelper.DefaultCapacity, writable: true, publiclyVisible: true);
byte[] blob = System.Buffers.ArrayPool<byte>.Shared.Rent(capacity);
MemoryStream memStreamPayload = new MemoryStream(blob, 0, capacity, writable: true, publiclyVisible: true);
memStreamPayload.SetLength(0);
memStreamPayload.Position = 0;
using (StreamWriter streamWriter = new StreamWriter(memStreamPayload,
encoding: JsonHelper.DefaultEncoding,
bufferSize: JsonHelper.DefaultCapacity,
bufferSize: capacity,
leaveOpen: true))
{
using (JsonWriter writer = new JsonTextWriter(streamWriter))
Expand Down
4 changes: 2 additions & 2 deletions Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ sleep 10 #Wait
dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithTelemetry --enableTelemetry --telemetryScheduleInSec 60 --telemetryEndpoint $TELEMETRY_ENDPOINT --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk
sleep 10 #Wait

# Open telemetry enabled ReadStreamExistsV3. This is needed to see the impact of open telemetry.
dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithOpenTelemetry --enableOpenTelemetry --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk
# Open telemetry enabled ReadStreamExistsV3. This is needed to see the impact of distributed tracing (without listener)
dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithDistributedTracingWOListener --enableDistributedTracing --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk
sleep 10 #Wait

#Point read operations
Expand Down
9 changes: 8 additions & 1 deletion Microsoft.Azure.Cosmos.Samples/Tools/CTL/CTLConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace CosmosCTL
using CommandLine.Text;
using Microsoft.Azure.Cosmos;
using Newtonsoft.Json;
using static CosmosCTL.ReservoirProvider;

public class CTLConfig
{
Expand Down Expand Up @@ -76,7 +77,7 @@ public string DiagnosticsThresholdDuration
}

[Option("ctl_content_response_on_write", Required = false, HelpText = "Should return content response on writes")]
public bool IsContentResponseOnWriteEnabled { get; set; } = true;
public bool? IsContentResponseOnWriteEnabled { get; set; } = true;

[Option("ctl_output_event_traces", Required = false, HelpText = "Outputs TraceSource to console")]
public bool OutputEventTraces { get; set; } = false;
Expand All @@ -102,6 +103,12 @@ public string DiagnosticsThresholdDuration
[Option("ctl_telemetry_schedule_in_sec", Required = false, HelpText = "telemetry task schedule time in sec")]
public string TelemetryScheduleInSeconds { get; set; }

[Option("ctl_reservoir_type", Required = false, HelpText = "Defines the reservoir type. Valid values are: Uniform, SlidingWindow and ExponentialDecay. The default value is SlidingWindow.")]
public ReservoirTypes ReservoirType { get; set; } = ReservoirTypes.SlidingWindow;

[Option("ctl_reservoir_sample_size", Required = false, HelpText = "The reservoir sample size.")]
public int ReservoirSampleSize { get; set; } = 1028;

internal TimeSpan RunningTimeDurationAsTimespan { get; private set; } = TimeSpan.FromHours(10);
internal TimeSpan DiagnosticsThresholdDurationAsTimespan { get; private set; } = TimeSpan.FromSeconds(60);

Expand Down
Loading