-
Notifications
You must be signed in to change notification settings - Fork 4.6k
/
AverageServiceLoadScalingTrigger.cs
71 lines (63 loc) · 5.33 KB
/
AverageServiceLoadScalingTrigger.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
using Azure.Core;
namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models
{
/// <summary> Represents a scaling policy related to an average load of a metric/resource of a service. </summary>
public partial class AverageServiceLoadScalingTrigger : ManagedServiceScalingTrigger
{
/// <summary> Initializes a new instance of <see cref="AverageServiceLoadScalingTrigger"/>. </summary>
/// <param name="metricName"> The name of the metric for which usage should be tracked. </param>
/// <param name="lowerLoadThreshold"> The lower limit of the load below which a scale in operation should be performed. </param>
/// <param name="upperLoadThreshold"> The upper limit of the load beyond which a scale out operation should be performed. </param>
/// <param name="scaleInterval"> The period in seconds on which a decision is made whether to scale or not. This property should come in ISO 8601 format "hh:mm:ss". </param>
/// <param name="useOnlyPrimaryLoad"> Flag determines whether only the load of primary replica should be considered for scaling. If set to true, then trigger will only consider the load of primary replicas of stateful service. If set to false, trigger will consider load of all replicas. This parameter cannot be set to true for stateless service. </param>
/// <exception cref="ArgumentNullException"> <paramref name="metricName"/> or <paramref name="scaleInterval"/> is null. </exception>
public AverageServiceLoadScalingTrigger(string metricName, double lowerLoadThreshold, double upperLoadThreshold, string scaleInterval, bool useOnlyPrimaryLoad)
{
Argument.AssertNotNull(metricName, nameof(metricName));
Argument.AssertNotNull(scaleInterval, nameof(scaleInterval));
MetricName = metricName;
LowerLoadThreshold = lowerLoadThreshold;
UpperLoadThreshold = upperLoadThreshold;
ScaleInterval = scaleInterval;
UseOnlyPrimaryLoad = useOnlyPrimaryLoad;
Kind = ServiceScalingTriggerKind.AverageServiceLoadTrigger;
}
/// <summary> Initializes a new instance of <see cref="AverageServiceLoadScalingTrigger"/>. </summary>
/// <param name="kind"> Specifies the trigger associated with this scaling policy. </param>
/// <param name="serializedAdditionalRawData"> Keeps track of any properties unknown to the library. </param>
/// <param name="metricName"> The name of the metric for which usage should be tracked. </param>
/// <param name="lowerLoadThreshold"> The lower limit of the load below which a scale in operation should be performed. </param>
/// <param name="upperLoadThreshold"> The upper limit of the load beyond which a scale out operation should be performed. </param>
/// <param name="scaleInterval"> The period in seconds on which a decision is made whether to scale or not. This property should come in ISO 8601 format "hh:mm:ss". </param>
/// <param name="useOnlyPrimaryLoad"> Flag determines whether only the load of primary replica should be considered for scaling. If set to true, then trigger will only consider the load of primary replicas of stateful service. If set to false, trigger will consider load of all replicas. This parameter cannot be set to true for stateless service. </param>
internal AverageServiceLoadScalingTrigger(ServiceScalingTriggerKind kind, IDictionary<string, BinaryData> serializedAdditionalRawData, string metricName, double lowerLoadThreshold, double upperLoadThreshold, string scaleInterval, bool useOnlyPrimaryLoad) : base(kind, serializedAdditionalRawData)
{
MetricName = metricName;
LowerLoadThreshold = lowerLoadThreshold;
UpperLoadThreshold = upperLoadThreshold;
ScaleInterval = scaleInterval;
UseOnlyPrimaryLoad = useOnlyPrimaryLoad;
Kind = kind;
}
/// <summary> Initializes a new instance of <see cref="AverageServiceLoadScalingTrigger"/> for deserialization. </summary>
internal AverageServiceLoadScalingTrigger()
{
}
/// <summary> The name of the metric for which usage should be tracked. </summary>
public string MetricName { get; set; }
/// <summary> The lower limit of the load below which a scale in operation should be performed. </summary>
public double LowerLoadThreshold { get; set; }
/// <summary> The upper limit of the load beyond which a scale out operation should be performed. </summary>
public double UpperLoadThreshold { get; set; }
/// <summary> The period in seconds on which a decision is made whether to scale or not. This property should come in ISO 8601 format "hh:mm:ss". </summary>
public string ScaleInterval { get; set; }
/// <summary> Flag determines whether only the load of primary replica should be considered for scaling. If set to true, then trigger will only consider the load of primary replicas of stateful service. If set to false, trigger will consider load of all replicas. This parameter cannot be set to true for stateless service. </summary>
public bool UseOnlyPrimaryLoad { get; set; }
}
}