Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/DurableTask.SqlServer.AzureFunctions/SqlScaleMetric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ namespace DurableTask.SqlServer.AzureFunctions
{
using Microsoft.Azure.WebJobs.Host.Scale;

class SqlScaleMetric : ScaleMetrics
/// <summary>
/// Contains metrics used to make scale decisions for a SqlScaleMetric.
/// </summary>
public class SqlScaleMetric : ScaleMetrics
{
public int RecommendedReplicaCount { get; set; }
}
Expand Down
8 changes: 7 additions & 1 deletion src/DurableTask.SqlServer.AzureFunctions/SqlScaleMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace DurableTask.SqlServer.AzureFunctions
/// <summary>
/// Azure Functions scale monitor implementation for the Durable Functions SQL backend.
/// </summary>
class SqlScaleMonitor : IScaleMonitor<SqlScaleMetric>
public class SqlScaleMonitor : IScaleMonitor<SqlScaleMetric>
{
static readonly ScaleStatus ScaleInVote = new ScaleStatus { Vote = ScaleVote.ScaleIn };
static readonly ScaleStatus NoScaleVote = new ScaleStatus { Vote = ScaleVote.None };
Expand All @@ -23,6 +23,12 @@ class SqlScaleMonitor : IScaleMonitor<SqlScaleMetric>

int? previousWorkerCount = -1;

/// <summary>
/// Creates a SqlScaleMonitor instance.
/// </summary>
/// <param name="service">The SqlOrchestrationService used to create the connection.</param>
/// <param name="taskHubName">The name of the monitored task hub.</param>
/// <exception cref="ArgumentNullException"></exception>
public SqlScaleMonitor(SqlOrchestrationService service, string taskHubName)
{
this.service = service ?? throw new ArgumentNullException(nameof(service));
Expand Down