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(); }
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; }
public ResourceKey(ResourceMetricType metric, string id) { this.MetricType = metric; this.Id = id; }
public ResourceMetricPolicy(ResourceMetricType type, WorkloadClassification classification) : this(type, classification, VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null)) { }
public ResourceMetricPolicy(ResourceMetricType type, WorkloadClassification classification, VariantConfigurationSnapshot config) : this(type, classification, config.WorkloadManagement.GetObject <IResourceSettings>(type, new object[0])) { }