-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Eventhub Stress Test Onboarding #28320
Eventhub Stress Test Onboarding #28320
Conversation
This pull request is protected by Check Enforcer. |
...nthub/Azure.Messaging.EventHubs.Shared/src/Azure.Messaging.EventHubs.Shared.Stress.projitems
Outdated
Show resolved
Hide resolved
COPY /sdk/eventhub/Azure.Messaging.EventHubs/ /app/sdk/eventhub/Azure.Messaging.EventHubs/ | ||
COPY /eng /app/eng | ||
COPY /tools /app/tools |
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.
Do these also need to be ./
instead of /
?
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.
They're referencing the root, and aren't relative to the current directory, so I believe they're correct as written.
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.
@benbp: Any thoughts on templatizing some of this? The inclusions here will be needed for any .NET library to build due to the engsys dependencies.
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.
@jsquire I'm definitely in favor of common stress components, either global or language level. For this dockerfile, my initial thought would be to create an intermediate builder image, so you then you can do something like FROM azsdkengsys.azurecr.io/stress/dotnet/base AS build-env
?
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.
Development could be somewhat annoying if you're iterating on both, so we may want to provide a way to build multiple dockerfiles in sequence if it starts getting iterated on heavily.
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.
I really like the idea of the intermediate image.
# TODO: how to update registry path | ||
|
||
Set-Location -Path ..\..\..\..\ | ||
Set-Location -Path .\artifacts\bin\Azure.Messaging.EventHubs.Stress\Debug\netcoreapp3.1 |
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.
This script will fail the first time you run it if you have no eventhubs build.
``` | ||
|
||
### Running Tests | ||
When tests are run locally, Azure resources need to be created prior to running the test. This can be done through the Azure CLI, an ARM template or bicep file, or the Azure Portal. The user is required to input the connection strings upon request on the command line when the test is being run. For more information about what resources are needed for each test, see the "Scenario Information" section below. |
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.
@ckairen I think we should also support a "deploy resources only" type mode to make local testing easier with resources.
@@ -0,0 +1,165 @@ | |||
{ |
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.
I would avoid checking this file in and also add a .gitignore
for it (example) since it's an intermediate artifact.
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.
Omitting it will help ensure we don't have confusion where someone who wants to make a change edits this template rather than the bicep file and gets confused when it doesn't work.
@description('The location of the resource group.') | ||
param location string = resourceGroup().location | ||
|
||
var eventHubsNamespace_var = 'eh-${resourceGroup().name}' |
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.
If you only use the resource group name here, it will be a little simpler to use the auto-generated namespace URL in the network blocking config, but it should still work fine with eh-
we'll just have to remember to add it in other places.
A couple nits/suggestions but the stress configuration pieces LGTM. |
|
||
Please see our [contributing guide](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/eventhub/Azure.Messaging.EventHubs/CONTRIBUTING.md) for more information. | ||
|
||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net%2Fsdk%2Feventhub%2FAzure.Messaging.EventHubs%2stress%2FREADME.png) |
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.
This png fails to load on the readme.
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.
Loads for me; it's one of our tracking pixels, so it will look like nothing. @benbp: Are you seeing it 404 or just nothing show up?
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.
@jsquire it looks like the problem is a missing F
character in the url encoding: EventHubs %2 stress
. I added a commit suggestion below.
It looks like this on the readme, that's how I caught it:
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.
ahhh.... I see it now. Yeah, that's on me. Thanks for the catch!
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.
Chrome/Edge do a nice job of fixing the malformed encoding. Checking in the browser worked.
@@ -5,7 +5,7 @@ | |||
"_generator": { | |||
"name": "bicep", | |||
"version": "0.4.1318.3566", | |||
"templateHash": "9849786101028970025" |
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.
I think because you previously checked this in, the .gitignore won't automatically remove it. So you have to manually remove it with git rm
and commit the file deletion.
sdk/eventhub/Azure.Messaging.EventHubs/stress/src/Infrastructure/BufferedProducerTestConfig.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/stress/src/Infrastructure/BufferedPublisher.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/stress/src/Infrastructure/BufferedPublisher.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/stress/src/Scenarios/BufferedProducerTest.cs
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/stress/src/Scenarios/EventProducerTest.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/stress/stress-test-resources.bicep
Show resolved
Hide resolved
We should add the |
Co-authored-by: Ben Broderick Phillips <[email protected]>
sdk/eventhub/Azure.Messaging.EventHubs/stress/src/Configurations/BufferedProducerTestConfig.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/stress/src/Configurations/BufferedProducerTestConfig.cs
Outdated
Show resolved
Hide resolved
|
||
// Create the buffered producer client and register the success and failure handlers | ||
|
||
var options = new EventHubBufferedProducerClientOptions |
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.
The Buffered Producer has some adjustments to the standard defaults for retry policy if the options aren't explicitly passed. We should mirror them for the test, since that'll be our majority case.
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.
If you have ideas on how we can better detect and adjust retry configuration when the individual values aren't set, I'd be very interested in hearing them. The best that I can think of is creating a mirrored type inside the buffered options. Maybe we should explore that as a quick interlude between phase 1 and phase 2.
sdk/eventhub/Azure.Messaging.EventHubs/stress/src/Infrastructure/BufferedPublisher.cs
Outdated
Show resolved
Hide resolved
{ | ||
// If this catch is hit, it means the producer has restarted, collect metrics. | ||
|
||
_metrics.Client.GetMetric(_metrics.ProducerRestarted).TrackValue(1); |
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.
Does this increment the count or are we collecting these as individual events and then aggregating via Kusto?
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.
@jsquire The GetMetric method is cool it aggregates (in this case sums) up all the values sent via "TrackValue" and sends them all at once:
"In summary GetMetric() is the recommended approach since it does pre-aggregation, it accumulates values from all the Track() calls and sends a summary/aggregate once every minute. This can significantly reduce the cost and performance overhead by sending fewer data points, while still collecting all relevant information." ref
The long-term aggregation like total sum is done in Kusto.
sdk/eventhub/Azure.Messaging.EventHubs/stress/src/Infrastructure/EnvironmentReader.cs
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/stress/src/Infrastructure/Publisher.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs/stress/src/Infrastructure/Publisher.cs
Outdated
Show resolved
Hide resolved
…re/Publisher.cs Co-authored-by: Jesse Squire <[email protected]>
…ns/BufferedProducerTestConfig.cs Co-authored-by: Jesse Squire <[email protected]>
…ns/BufferedProducerTestConfig.cs Co-authored-by: Jesse Squire <[email protected]>
Contributing to the Azure SDK
Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.
For specific information about pull request etiquette and best practices, see this section.