-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Azure.Monitor.Ingestion] Add Concurrency Upload method #31074
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
Nisha Bhatia (nisha-bhatia)
merged 22 commits into
Azure:main
from
nisha-bhatia:addConcurrency
Sep 23, 2022
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
dca3de2
wip
nisha-bhatia 5087ea9
Merge remote-tracking branch 'upstream/main' into addConcurrency
nisha-bhatia 3ce16c4
wip
nisha-bhatia c8560a9
wip
nisha-bhatia d8b6f64
wip
nisha-bhatia d65bc76
wip
nisha-bhatia c13c5b1
wip
nisha-bhatia aede3a5
wip
nisha-bhatia c5e520b
wip
nisha-bhatia d12e916
wip
nisha-bhatia 929e94e
Update CHANGELOG.md
nisha-bhatia 58775c4
add internal
nisha-bhatia d989610
wip
nisha-bhatia 8352660
wip
nisha-bhatia f315c90
Update ConcurrencyMultiThreadAsync.json
nisha-bhatia 6ff04e8
wip
nisha-bhatia dee1ea7
wip
nisha-bhatia 4a51494
Merge remote-tracking branch 'upstream/main' into addConcurrency
nisha-bhatia 7d09e8c
Update ConcurrencyMultiThreadAsync.json
nisha-bhatia 6a60341
Merge remote-tracking branch 'upstream/main' into addConcurrency
nisha-bhatia c5449bc
wip
nisha-bhatia 42ea061
update changelog for release
nisha-bhatia 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
25 changes: 25 additions & 0 deletions
25
sdk/monitor/Azure.Monitor.Ingestion/src/Models/UploadLogsOptions.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,25 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System.ComponentModel; | ||
| using Azure.Core.Serialization; | ||
| using System.Text.Json; | ||
|
|
||
| namespace Azure.Monitor.Ingestion | ||
| { | ||
| /// <summary> | ||
| /// The options model to configure the request to upload logs to Azure Monitor. | ||
| /// </summary> | ||
| public class UploadLogsOptions | ||
| { | ||
| /// <summary> | ||
| /// The serializer to use to convert the log objects to JSON. | ||
|
nisha-bhatia marked this conversation as resolved.
|
||
| /// </summary> | ||
| public ObjectSerializer ObjectSerializer { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// The max concurrent requests to send to the Azure Monitor service when uploading logs. | ||
| /// </summary> | ||
| public int MaxConcurrency { get; set; } | ||
|
nisha-bhatia marked this conversation as resolved.
|
||
| } | ||
| } | ||
29 changes: 29 additions & 0 deletions
29
sdk/monitor/Azure.Monitor.Ingestion/tests/ConcurrencyCounterPolicy.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,29 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
| using Azure.Core; | ||
| using Azure.Core.Pipeline; | ||
|
|
||
| namespace Azure.Monitor.Ingestion.Tests | ||
| { | ||
| internal class ConcurrencyCounterPolicy : HttpPipelinePolicy | ||
|
nisha-bhatia marked this conversation as resolved.
|
||
| { | ||
| public volatile int count; | ||
| public override void Process(HttpMessage message, ReadOnlyMemory<HttpPipelinePolicy> pipeline) | ||
| { | ||
| Interlocked.Increment(ref count); | ||
| ProcessNext(message, pipeline); | ||
| Interlocked.Decrement(ref count); | ||
| } | ||
|
|
||
| public override async ValueTask ProcessAsync(HttpMessage message, ReadOnlyMemory<HttpPipelinePolicy> pipeline) | ||
| { | ||
| Interlocked.Increment(ref count); | ||
| await ProcessNextAsync(message, pipeline).ConfigureAwait(false); | ||
| Interlocked.Decrement(ref count); | ||
| } | ||
| } | ||
| } | ||
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.