MetricTrigger Class
- java.
lang. Object - com.
azure. resourcemanager. monitor. models. MetricTrigger
- com.
Implements
public final class MetricTrigger
implements JsonSerializable<MetricTrigger>
The trigger that results in a scaling action.
Constructor Summary
Constructor | Description |
---|---|
MetricTrigger() |
Creates an instance of Metric |
Method Summary
Modifier and Type | Method and Description |
---|---|
List<Scale |
dimensions()
Get the dimensions property: List of dimension conditions. |
Boolean |
dividePerInstance()
Get the divide |
static
Metric |
fromJson(JsonReader jsonReader)
Reads an instance of Metric |
String |
metricName()
Get the metric |
String |
metricNamespace()
Get the metric |
String |
metricResourceLocation()
Get the metric |
String |
metricResourceUri()
Get the metric |
Comparison |
operator()
Get the operator property: the operator that is used to compare the metric data and the threshold. |
Metric |
statistic()
Get the statistic property: the metric statistic type. |
double |
threshold()
Get the threshold property: the threshold of the metric that triggers the scale action. |
Time |
timeAggregation()
Get the time |
Duration |
timeGrain()
Get the time |
Duration |
timeWindow()
Get the time |
Json |
toJson(JsonWriter jsonWriter) |
void |
validate()
Validates the instance. |
Metric |
withDimensions(List<ScaleRuleMetricDimension> dimensions)
Set the dimensions property: List of dimension conditions. |
Metric |
withDividePerInstance(Boolean dividePerInstance)
Set the divide |
Metric |
withMetricName(String metricName)
Set the metric |
Metric |
withMetricNamespace(String metricNamespace)
Set the metric |
Metric |
withMetricResourceLocation(String metricResourceLocation)
Set the metric |
Metric |
withMetricResourceUri(String metricResourceUri)
Set the metric |
Metric |
withOperator(ComparisonOperationType operator)
Set the operator property: the operator that is used to compare the metric data and the threshold. |
Metric |
withStatistic(MetricStatisticType statistic)
Set the statistic property: the metric statistic type. |
Metric |
withThreshold(double threshold)
Set the threshold property: the threshold of the metric that triggers the scale action. |
Metric |
withTimeAggregation(TimeAggregationType timeAggregation)
Set the time |
Metric |
withTimeGrain(Duration timeGrain)
Set the time |
Metric |
withTimeWindow(Duration timeWindow)
Set the time |
Methods inherited from java.lang.Object
Constructor Details
MetricTrigger
public MetricTrigger()
Creates an instance of MetricTrigger class.
Method Details
dimensions
public List
Get the dimensions property: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}].
Returns:
dividePerInstance
public Boolean dividePerInstance()
Get the dividePerInstance property: a value indicating whether metric should divide per instance.
Returns:
fromJson
public static MetricTrigger fromJson(JsonReader jsonReader)
Reads an instance of MetricTrigger from the JsonReader.
Parameters:
Returns:
Throws:
metricName
public String metricName()
Get the metricName property: the name of the metric that defines what the rule monitors.
Returns:
metricNamespace
public String metricNamespace()
Get the metricNamespace property: the namespace of the metric that defines what the rule monitors.
Returns:
metricResourceLocation
public String metricResourceLocation()
Get the metricResourceLocation property: the location of the resource the rule monitors.
Returns:
metricResourceUri
public String metricResourceUri()
Get the metricResourceUri property: the resource identifier of the resource the rule monitors.
Returns:
operator
public ComparisonOperationType operator()
Get the operator property: the operator that is used to compare the metric data and the threshold.
Returns:
statistic
public MetricStatisticType statistic()
Get the statistic property: the metric statistic type. How the metrics from multiple instances are combined.
Returns:
threshold
public double threshold()
Get the threshold property: the threshold of the metric that triggers the scale action.
Returns:
timeAggregation
public TimeAggregationType timeAggregation()
Get the timeAggregation property: time aggregation type. How the data that is collected should be combined over time. The default value is Average.
Returns:
timeGrain
public Duration timeGrain()
Get the timeGrain property: the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute.
Returns:
timeWindow
public Duration timeWindow()
Get the timeWindow property: the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes.
Returns:
toJson
validate
public void validate()
Validates the instance.
withDimensions
public MetricTrigger withDimensions(List
Set the dimensions property: List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}].
Parameters:
Returns:
withDividePerInstance
public MetricTrigger withDividePerInstance(Boolean dividePerInstance)
Set the dividePerInstance property: a value indicating whether metric should divide per instance.
Parameters:
Returns:
withMetricName
public MetricTrigger withMetricName(String metricName)
Set the metricName property: the name of the metric that defines what the rule monitors.
Parameters:
Returns:
withMetricNamespace
public MetricTrigger withMetricNamespace(String metricNamespace)
Set the metricNamespace property: the namespace of the metric that defines what the rule monitors.
Parameters:
Returns:
withMetricResourceLocation
public MetricTrigger withMetricResourceLocation(String metricResourceLocation)
Set the metricResourceLocation property: the location of the resource the rule monitors.
Parameters:
Returns:
withMetricResourceUri
public MetricTrigger withMetricResourceUri(String metricResourceUri)
Set the metricResourceUri property: the resource identifier of the resource the rule monitors.
Parameters:
Returns:
withOperator
public MetricTrigger withOperator(ComparisonOperationType operator)
Set the operator property: the operator that is used to compare the metric data and the threshold.
Parameters:
Returns:
withStatistic
public MetricTrigger withStatistic(MetricStatisticType statistic)
Set the statistic property: the metric statistic type. How the metrics from multiple instances are combined.
Parameters:
Returns:
withThreshold
public MetricTrigger withThreshold(double threshold)
Set the threshold property: the threshold of the metric that triggers the scale action.
Parameters:
Returns:
withTimeAggregation
public MetricTrigger withTimeAggregation(TimeAggregationType timeAggregation)
Set the timeAggregation property: time aggregation type. How the data that is collected should be combined over time. The default value is Average.
Parameters:
Returns:
withTimeGrain
public MetricTrigger withTimeGrain(Duration timeGrain)
Set the timeGrain property: the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute.
Parameters:
Returns:
withTimeWindow
public MetricTrigger withTimeWindow(Duration timeWindow)
Set the timeWindow property: the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes.
Parameters:
Returns:
Applies to
Azure SDK for Java