-
Notifications
You must be signed in to change notification settings - Fork 33
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
Use Singleton Metrics Provider for Listener #285
Merged
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b7e7995
initial commit
nytian 62fca50
update version
nytian 309526e
add nullable makr
nytian 83a9554
udpate test
nytian 47cdece
remove back to v1.5.1
nytian c0b2720
Fix typo in CHANGELOG.md entry
nytian 16e4bf5
Update Directory.Packages.props
nytian 349156c
update scalemonitor and target scaler per functionid
nytian fbb899a
update comments
nytian 89de7d9
update by comments:
nytian 5c161b8
add query metrics throttle
nytian d95d8ca
refactor code a little bit:
nytian 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 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
Binary file not shown.
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 |
---|---|---|
|
@@ -12,14 +12,12 @@ public class SqlTargetScaler : ITargetScaler | |
{ | ||
readonly SqlMetricsProvider sqlMetricsProvider; | ||
|
||
public SqlTargetScaler(string taskHubName, SqlMetricsProvider sqlMetricsProvider) | ||
public SqlTargetScaler(string functionId, SqlMetricsProvider sqlMetricsProvider) | ||
{ | ||
this.sqlMetricsProvider = sqlMetricsProvider; | ||
|
||
// Scalers in Durable Functions are shared for all functions in the same task hub. | ||
// So instead of using a function ID, we use the task hub name as the basis for the descriptor ID. | ||
string id = $"DurableTask-SqlServer:{taskHubName ?? "default"}"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
this.TargetScalerDescriptor = new TargetScalerDescriptor(id); | ||
// Scalers in Durable Functions is per function ids. And scalers share the same sqlMetricsProvider in the same taskhub. | ||
this.TargetScalerDescriptor = new TargetScalerDescriptor(functionId); | ||
} | ||
|
||
public TargetScalerDescriptor TargetScalerDescriptor { get; } | ||
|
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.
One last thing. I recall the final fix that Alexey made to the Azure Storage metrics provider was to throttle it so that we only fetch metrics once every few seconds or so. This is how we ensured that we don't have too many storage transactions, even if the app has a lot of triggers. I think it will be important to do that for the
SqlMetricsProvider
too so that we don't overwhelm the customer's database with expensive SQL queries.