-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add target based scaling support for MSSQL #169
base: main
Are you sure you want to change the base?
Conversation
this.TargetScalerDescriptor = new TargetScalerDescriptor(functionId); | ||
} | ||
|
||
public TargetScalerDescriptor TargetScalerDescriptor { get; private set; } |
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.
nit: remove the private set
to make this a read-only property. You'll still be able to assign it from the constructor.
return true; | ||
} | ||
|
||
#if NETCOREAPP |
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.
Why do we need the #if NETCOREAPP
? Is there any problem if this code exists in both the netstandard2.0
and netcoreapp3.1
targets?
public class SqlTargetScaler : ITargetScaler | ||
{ | ||
readonly SqlMetricsProvider sqlMetricsProvider; | ||
readonly TargetScalerResult scaleResult; |
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.
Why do we cache the TargetScalerResult
object instead of creating a new one for each call?
This PR adds support for target based scaling. It builds upon Azure/azure-functions-durable-extension#2452. This PR is in draft mode since it hasn't been tested E2E yet.
Changes:
SqlMetricsProvider
and moveGetMetricsAsync()
code fromSqlScaleMonitor
hereSqlTargetScaler
(implementsITargetScaler
)TryGetTargetScaler
in SqlDurabilityProvider