コード例 #1
0
        public ResourceMetricPolicy(ResourceMetricType metricType, WorkloadClassification classification, IResourceSettings settings)
        {
            this.MetricType     = metricType;
            this.Classification = classification;
            switch (classification)
            {
            case WorkloadClassification.Discretionary:
                this.UnderloadedThreshold = settings.DiscretionaryUnderloaded;
                this.OverloadedThreshold  = settings.DiscretionaryOverloaded;
                this.CriticalThreshold    = settings.DiscretionaryCritical;
                break;

            case WorkloadClassification.InternalMaintenance:
                this.UnderloadedThreshold = settings.InternalMaintenanceUnderloaded;
                this.OverloadedThreshold  = settings.InternalMaintenanceOverloaded;
                this.CriticalThreshold    = settings.InternalMaintenanceCritical;
                break;

            case WorkloadClassification.CustomerExpectation:
                this.UnderloadedThreshold = settings.CustomerExpectationUnderloaded;
                this.OverloadedThreshold  = settings.CustomerExpectationOverloaded;
                this.CriticalThreshold    = settings.CustomerExpectationCritical;
                break;

            case WorkloadClassification.Urgent:
                this.UnderloadedThreshold = settings.UrgentUnderloaded;
                this.OverloadedThreshold  = settings.UrgentOverloaded;
                this.CriticalThreshold    = settings.UrgentCritical;
                break;
            }
            this.Validate();
        }
コード例 #2
0
 public MdbResourceKey(ResourceMetricType metric, Guid databaseGuid) : base(metric, MdbResourceKey.GetId(databaseGuid))
 {
     if (databaseGuid == Guid.Empty)
     {
         throw new ArgumentException("Guid.Empty is not a valid MdbGuid value", "mdbGuid");
     }
     this.DatabaseGuid = databaseGuid;
 }
コード例 #3
0
 public ResourceKey(ResourceMetricType metric, string id)
 {
     this.MetricType = metric;
     this.Id         = id;
 }
コード例 #4
0
 public ResourceMetricPolicy(ResourceMetricType type, WorkloadClassification classification) : this(type, classification, VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null))
 {
 }
コード例 #5
0
 public ResourceMetricPolicy(ResourceMetricType type, WorkloadClassification classification, VariantConfigurationSnapshot config) : this(type, classification, config.WorkloadManagement.GetObject <IResourceSettings>(type, new object[0]))
 {
 }