コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the ServiceTypeHealthPolicyMapItem class.
 /// </summary>
 /// <param name="key">The key of the service type health policy map item. This is the name of the service type.</param>
 /// <param name="value">The value of the service type health policy map item. This is the ServiceTypeHealthPolicy for
 /// this service type.</param>
 public ServiceTypeHealthPolicyMapItem(
     string key,
     ServiceTypeHealthPolicy value)
 {
     key.ThrowIfNull(nameof(key));
     value.ThrowIfNull(nameof(value));
     this.Key   = key;
     this.Value = value;
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the ApplicationHealthPolicy class.
 /// </summary>
 /// <param name="considerWarningAsError">Indicates whether warnings are treated with the same severity as
 /// errors.</param>
 /// <param name="maxPercentUnhealthyDeployedApplications">The maximum allowed percentage of unhealthy deployed
 /// applications. Allowed values are Byte values from zero to 100.
 /// The percentage represents the maximum tolerated percentage of deployed applications that can be unhealthy before
 /// the application is considered in error.
 /// This is calculated by dividing the number of unhealthy deployed applications over the number of nodes where the
 /// application is currently deployed on in the cluster.
 /// The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero.
 /// </param>
 /// <param name="defaultServiceTypeHealthPolicy">The health policy used by default to evaluate the health of a service
 /// type.</param>
 /// <param name="serviceTypeHealthPolicyMap">The map with service type health policy per service type name. The map is
 /// empty by default.</param>
 public ApplicationHealthPolicy(
     bool?considerWarningAsError = false,
     int?maxPercentUnhealthyDeployedApplications            = 0,
     ServiceTypeHealthPolicy defaultServiceTypeHealthPolicy = default(ServiceTypeHealthPolicy),
     IEnumerable <ServiceTypeHealthPolicyMapItem> serviceTypeHealthPolicyMap = default(IEnumerable <ServiceTypeHealthPolicyMapItem>))
 {
     this.ConsiderWarningAsError = considerWarningAsError;
     this.MaxPercentUnhealthyDeployedApplications = maxPercentUnhealthyDeployedApplications;
     this.DefaultServiceTypeHealthPolicy          = defaultServiceTypeHealthPolicy;
     this.ServiceTypeHealthPolicyMap = serviceTypeHealthPolicyMap;
 }