Moving scale code to web jobs sdk to resuse in SC v3.#8977
Moving scale code to web jobs sdk to resuse in SC v3.#8977
Conversation
| public ScaleOptionsSetup(IEnvironment environment, IOptions<FunctionsHostingConfigOptions> functionsHostingConfigOptions) | ||
| { | ||
| _environment = environment; | ||
| _functionsHostingConfigOptions = functionsHostingConfigOptions; |
There was a problem hiding this comment.
Do we want to throw if null?
_environment = environment ?? throw new ArgumentNullException(nameof(environment));
_functionsHostingConfigOptions = functionsHostingConfigOptions ?? ?? throw new ArgumentNullException(nameof(functionsHostingConfigOptions));
|
|
||
| private bool IsTargetBasedScalingEnabledForTrigger(ITargetScaler targetScaler) | ||
| { | ||
| string assemblyName = targetScaler.GetType().Assembly.GetName().Name; |
There was a problem hiding this comment.
| string assemblyName = targetScaler.GetType().Assembly.GetName().Name; | |
| string assemblyName = targetScaler?.GetType().Assembly.GetName().Name; |
| { | ||
| string assemblyName = targetScaler.GetType().Assembly.GetName().Name; | ||
| string flag = _functionsHostingConfigOptions.Value.GetFeature(assemblyName); | ||
| return flag == "1"; |
There was a problem hiding this comment.
Can we make "1" a constant with a name that describes what the 1 represents
| var logs = _loggerProvider.GetAllLogMessages().ToArray(); | ||
| Assert.Equal(1, logs.Length); | ||
| Assert.Equal("Runtime scale monitoring is enabled.", logs[0].FormattedMessage); | ||
| Assert.Equal("Scale monitor service started is started.", logs[0].FormattedMessage); |
There was a problem hiding this comment.
nit - should the message here be "Scale monitor service is started" ?
|
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
|
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
|
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
|
@alrod is this still blocked? WebJobs has been fully released |
@liliankasem Yes this is blocked, and this PR probably should have been marked Draft since it relies on Azure/azure-webjobs-sdk#2954. |
Thanks for the info! I'm going to go ahead and close this PR since it might be a while till 3.0.37 is out. Please open a new one when this is ready to go or reopen as a draft |
Issue describing the changes in this PR
resolves Azure/azure-webjobs-sdk#2938
Pull request checklist
release_notes.mdAdditional information
Additional PR information