-
Notifications
You must be signed in to change notification settings - Fork 494
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
Bulk API congestion control #1074
Merged
kirankumarkolli
merged 40 commits into
master
from
users/rakkuma/batch-api-congestion-control
Feb 25, 2020
Merged
Changes from 36 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
8f0e180
Bulk congestion control changes with perf optimizations
rakkuma f4ea89e
Resource stream null exception - To be reverted later
rakkuma fa63dc0
Fix
rakkuma 51c2134
Merging with master
rakkuma 7a675ca
fix
rakkuma b42a8ee
fix
rakkuma 2cd6b00
Code review fix
rakkuma c3cd1cb
Fixing program.cs
rakkuma 8ef1e99
correcting .json
rakkuma 0b96a30
fix
rakkuma d74df2e
Code review fix
rakkuma 0bf11cb
Null check removing
rakkuma ca55d83
Code review changes
rakkuma 3c604c2
Minor fix
rakkuma aa60e67
Fixing async
rakkuma af2a3b7
Typo fix
rakkuma f4d19c9
Merging with master
rakkuma 2f3b29f
Few fix and adding flag for congestion control
rakkuma 9de509d
Minor fixes
rakkuma bbbd0e0
Merge branch 'master' into users/rakkuma/batch-api-congestion-control
rakkuma 483437e
Fixing contract
rakkuma 9db1625
Moving congestion control logic to streamer
rakkuma 8a5e75a
Code review changes
rakkuma 942cb87
Batcher test case fix
rakkuma c5df4d9
Code review fix
rakkuma 23ea17a
Merging with master
rakkuma 9c3a57f
Adding unit test case
rakkuma f453121
Fix
rakkuma a172308
test case non flaky
rakkuma c582eb7
Fixing assert
rakkuma 1b41d41
Renaming of EnableCongestionControlForBulkExecution to EnableAdaptive…
rakkuma 7c9fea8
Contract changes
rakkuma 44e7a04
Flaky test case fix
rakkuma 471d5de
Code review changes
rakkuma 2d9d109
Contract changes
rakkuma 8b88985
Merge branch 'master' into users/rakkuma/batch-api-congestion-control
rakkuma 21dd69f
Reverting change for not exposing congestion control knob
rakkuma 3bad759
Code review fix
rakkuma 0f038fc
Minor fix
rakkuma 39c8061
Merge branch 'master' of https://github.com/Azure/azure-cosmos-dotnet…
rakkuma 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
13 changes: 13 additions & 0 deletions
13
Microsoft.Azure.Cosmos.Samples/Usage/BulkSupport/AppSettings.json
This file contains 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,13 @@ | ||
{ | ||
"EndPointUrl": "https://localhost:8081", | ||
"AuthorizationKey": "Super secret key", | ||
"DatabaseName": "samples", | ||
"ContainerName": "bulk-support", | ||
"CollectionThroughput": "100000", | ||
"ShouldCleanupOnStart": "false", | ||
"ShouldCleanupOnFinish": "false", | ||
"ItemSize": "400", | ||
"ItemsToCreate": "10000", | ||
"RuntimeInSeconds": "300", | ||
"numWorkers": "1" | ||
} |
This file contains 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
316 changes: 226 additions & 90 deletions
316
Microsoft.Azure.Cosmos.Samples/Usage/BulkSupport/Program.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 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 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,90 @@ | ||
//------------------------------------------------------------ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
//------------------------------------------------------------ | ||
|
||
namespace Microsoft.Azure.Cosmos | ||
{ | ||
using System; | ||
|
||
internal sealed class BatchPartitionMetric | ||
{ | ||
public BatchPartitionMetric() | ||
: this(0, 0, 0) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the OperationMetrics class (instance constructor). | ||
/// </summary> | ||
/// <param name="numberOfDocumentsOperatedOn">Number of documents operated on.</param> | ||
rakkuma marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/// <param name="timeTakenInMilliseconds">Amount of time taken to insert the documents.</param> | ||
/// <param name="numberOfThrottles">The number of throttles encountered to insert the documents.</param> | ||
public BatchPartitionMetric(long numberOfDocumentsOperatedOn, long timeTakenInMilliseconds, long numberOfThrottles) | ||
{ | ||
if (numberOfDocumentsOperatedOn < 0) | ||
{ | ||
throw new ArgumentException("numberOfDocumentsOperatedOn must be non negative"); | ||
} | ||
|
||
if (timeTakenInMilliseconds < 0) | ||
{ | ||
throw new ArgumentException("timeTakenInMilliseconds must be non negative"); | ||
} | ||
|
||
if (numberOfThrottles < 0) | ||
{ | ||
throw new ArgumentException("numberOfThrottles must be non negative"); | ||
} | ||
|
||
this.NumberOfDocumentsOperatedOn = numberOfDocumentsOperatedOn; | ||
this.TimeTakenInMilliseconds = timeTakenInMilliseconds; | ||
this.NumberOfThrottles = numberOfThrottles; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the number of documents operated on. | ||
/// </summary> | ||
public long NumberOfDocumentsOperatedOn | ||
{ | ||
get; private set; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the time taken to operate on the documents. | ||
/// </summary> | ||
public long TimeTakenInMilliseconds | ||
{ | ||
get; private set; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the number of throttles incurred while operating on the documents. | ||
/// </summary> | ||
public long NumberOfThrottles | ||
{ | ||
get; private set; | ||
} | ||
|
||
public void Add(long numberOfDocumentsOperatedOn, long timeTakenInMilliseconds, long numberOfThrottles) | ||
{ | ||
if (numberOfDocumentsOperatedOn < 0) | ||
{ | ||
throw new ArgumentException("numberOfDocumentsOperatedOn must be non negative"); | ||
} | ||
|
||
if (timeTakenInMilliseconds < 0) | ||
{ | ||
throw new ArgumentException("timeTakenInMilliseconds must be non negative"); | ||
} | ||
|
||
if (numberOfThrottles < 0) | ||
{ | ||
throw new ArgumentException("numberOfThrottles must be non negative"); | ||
} | ||
|
||
this.NumberOfDocumentsOperatedOn += numberOfDocumentsOperatedOn; | ||
rakkuma marked this conversation as resolved.
Show resolved
Hide resolved
|
||
this.TimeTakenInMilliseconds += timeTakenInMilliseconds; | ||
this.NumberOfThrottles += numberOfThrottles; | ||
} | ||
} | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@j82w how about capturing it part of user-agent for telemetry?