-
Notifications
You must be signed in to change notification settings - Fork 533
[Thin Client Integration] Benchmark tests: Adds tests for thinclient mode dataplane scenarios. #5228
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
Merged
kirankumarkolli
merged 21 commits into
master
from
users/aavasthy/5166_AddBenchmarkTests
Jun 27, 2025
Merged
[Thin Client Integration] Benchmark tests: Adds tests for thinclient mode dataplane scenarios. #5228
Changes from 10 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
bd33d67
Update benchmark tools test.
aavasthy f5a3367
Update test classes for thinclient workload.
aavasthy fde305e
Update run.sh for running thinclient only
aavasthy 9a55ae4
Update runs.sh logic for thinclient
aavasthy ae678f2
Set thinclient environment variable.
aavasthy 419961e
Merge branch 'master' into users/aavasthy/5166_AddBenchmarkTests
aavasthy beb5cc6
Code cleanup.
aavasthy 9164c39
Merge branch 'master' into users/aavasthy/5166_AddBenchmarkTests
aavasthy 5e721e6
Merge branch 'master' into users/aavasthy/5166_AddBenchmarkTests
aavasthy 7466146
Update tests.
aavasthy 11f9ba8
Merge branch 'master' into users/aavasthy/5166_AddBenchmarkTests
aavasthy 04edb76
Include different modes.
aavasthy e006231
Code cleanup.
aavasthy 3212720
Update run.sh
aavasthy dd033e4
Update connection mode logic in run.sh
aavasthy 8eaf6e8
Update run.sh to run workloads for all three modes
aavasthy 4fc43a8
Merge branch 'master' into users/aavasthy/5166_AddBenchmarkTests
kundadebdatta 675248c
Remove redundant tests.
aavasthy e6d58e1
Merge branch 'master' into users/aavasthy/5166_AddBenchmarkTests
aavasthy df54ca0
Merge branch 'master' into users/aavasthy/5166_AddBenchmarkTests
aavasthy 0fa78bc
Merge branch 'master' into users/aavasthy/5166_AddBenchmarkTests
kundadebdatta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/CreateItemStreamV3BenchmarkOperation.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| //------------------------------------------------------------ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| //------------------------------------------------------------ | ||
|
|
||
| namespace CosmosBenchmark | ||
| { | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.IO; | ||
| using System.Threading.Tasks; | ||
| using Microsoft.Azure.Cosmos; | ||
|
|
||
|
aavasthy marked this conversation as resolved.
Outdated
|
||
| internal class CreateItemStreamV3BenchmarkOperation : IBenchmarkOperation | ||
| { | ||
| private readonly Container container; | ||
| private readonly string partitionKeyPath; | ||
| private readonly Dictionary<string, object> sampleJObject; | ||
| private readonly string databaseName; | ||
| private readonly string containerName; | ||
|
|
||
| public CreateItemStreamV3BenchmarkOperation( | ||
| CosmosClient cosmosClient, | ||
| string dbName, | ||
| string containerName, | ||
| string partitionKeyPath, | ||
| string sampleJson) | ||
| { | ||
| this.databaseName = dbName; | ||
| this.containerName = containerName; | ||
| this.container = cosmosClient.GetContainer(this.databaseName, this.containerName); | ||
| this.partitionKeyPath = partitionKeyPath.Replace("/", ""); | ||
| this.sampleJObject = JsonHelper.Deserialize<Dictionary<string, object>>(sampleJson); | ||
| } | ||
|
|
||
| public BenchmarkOperationType OperationType => BenchmarkOperationType.Insert; | ||
|
|
||
| public Task PrepareAsync() | ||
| { | ||
| this.sampleJObject["id"] = Guid.NewGuid().ToString(); | ||
| this.sampleJObject[this.partitionKeyPath] = Guid.NewGuid().ToString(); | ||
| return Task.CompletedTask; | ||
| } | ||
|
|
||
| public async Task<OperationResult> ExecuteOnceAsync() | ||
| { | ||
| PartitionKey partitionKey = new PartitionKey(this.sampleJObject[this.partitionKeyPath].ToString()); | ||
| using (MemoryStream input = JsonHelper.ToStream(this.sampleJObject)) | ||
| { | ||
| ResponseMessage itemResponse = await this.container.CreateItemStreamAsync(input, partitionKey); | ||
|
|
||
| return new OperationResult | ||
| { | ||
| DatabseName = this.databaseName, | ||
| ContainerName = this.containerName, | ||
| OperationType = this.OperationType, | ||
| RuCharges = itemResponse.Headers.RequestCharge, | ||
| CosmosDiagnostics = itemResponse.Diagnostics, | ||
| LazyDiagnostics = () => itemResponse.Diagnostics.ToString(), | ||
| }; | ||
| } | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.