/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.computeoptimizer.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Describes the projected utilization metrics of an Amazon ECS service recommendation option. *
** To determine the performance difference between your current Amazon ECS service and the recommended option, compare * the utilization metric data of your service against its projected utilization metric data. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ECSServiceProjectedUtilizationMetric implements Serializable, Cloneable, StructuredPojo { /** ** The name of the projected utilization metric. *
** The following utilization metrics are available: *
*
* Cpu
— The percentage of allocated compute units that are currently in use on the service tasks.
*
* Memory
— The percentage of memory that's currently in use on the service tasks.
*
* The statistic of the projected utilization metric. *
*
* The Compute Optimizer API, Command Line Interface (CLI), and SDKs return utilization metrics using only the
* Maximum
statistic, which is the highest value observed during the specified period.
*
* The Compute Optimizer console displays graphs for some utilization metrics using the Average
* statistic, which is the value of Sum
/ SampleCount
during the specified period. For
* more information, see Viewing resource
* recommendations in the Compute Optimizer User Guide. You can also get averaged utilization metric data
* for your resources using Amazon CloudWatch. For more information, see the Amazon CloudWatch
* User Guide.
*
* The lower bound values for the projected utilization metrics. *
*/ private Double lowerBoundValue; /** ** The upper bound values for the projected utilization metrics. *
*/ private Double upperBoundValue; /** ** The name of the projected utilization metric. *
** The following utilization metrics are available: *
*
* Cpu
— The percentage of allocated compute units that are currently in use on the service tasks.
*
* Memory
— The percentage of memory that's currently in use on the service tasks.
*
* The following utilization metrics are available: *
*
* Cpu
— The percentage of allocated compute units that are currently in use on the service
* tasks.
*
* Memory
— The percentage of memory that's currently in use on the service tasks.
*
* The name of the projected utilization metric. *
** The following utilization metrics are available: *
*
* Cpu
— The percentage of allocated compute units that are currently in use on the service tasks.
*
* Memory
— The percentage of memory that's currently in use on the service tasks.
*
* The following utilization metrics are available: *
*
* Cpu
— The percentage of allocated compute units that are currently in use on the service
* tasks.
*
* Memory
— The percentage of memory that's currently in use on the service tasks.
*
* The name of the projected utilization metric. *
** The following utilization metrics are available: *
*
* Cpu
— The percentage of allocated compute units that are currently in use on the service tasks.
*
* Memory
— The percentage of memory that's currently in use on the service tasks.
*
* The following utilization metrics are available: *
*
* Cpu
— The percentage of allocated compute units that are currently in use on the service
* tasks.
*
* Memory
— The percentage of memory that's currently in use on the service tasks.
*
* The name of the projected utilization metric. *
** The following utilization metrics are available: *
*
* Cpu
— The percentage of allocated compute units that are currently in use on the service tasks.
*
* Memory
— The percentage of memory that's currently in use on the service tasks.
*
* The following utilization metrics are available: *
*
* Cpu
— The percentage of allocated compute units that are currently in use on the service
* tasks.
*
* Memory
— The percentage of memory that's currently in use on the service tasks.
*
* The statistic of the projected utilization metric. *
*
* The Compute Optimizer API, Command Line Interface (CLI), and SDKs return utilization metrics using only the
* Maximum
statistic, which is the highest value observed during the specified period.
*
* The Compute Optimizer console displays graphs for some utilization metrics using the Average
* statistic, which is the value of Sum
/ SampleCount
during the specified period. For
* more information, see Viewing resource
* recommendations in the Compute Optimizer User Guide. You can also get averaged utilization metric data
* for your resources using Amazon CloudWatch. For more information, see the Amazon CloudWatch
* User Guide.
*
* The Compute Optimizer API, Command Line Interface (CLI), and SDKs return utilization metrics using only
* the Maximum
statistic, which is the highest value observed during the specified period.
*
* The Compute Optimizer console displays graphs for some utilization metrics using the Average
* statistic, which is the value of Sum
/ SampleCount
during the specified period.
* For more information, see Viewing
* resource recommendations in the Compute Optimizer User Guide. You can also get averaged
* utilization metric data for your resources using Amazon CloudWatch. For more information, see the Amazon
* CloudWatch User Guide.
* @see ECSServiceMetricStatistic
*/
public void setStatistic(String statistic) {
this.statistic = statistic;
}
/**
*
* The statistic of the projected utilization metric. *
*
* The Compute Optimizer API, Command Line Interface (CLI), and SDKs return utilization metrics using only the
* Maximum
statistic, which is the highest value observed during the specified period.
*
* The Compute Optimizer console displays graphs for some utilization metrics using the Average
* statistic, which is the value of Sum
/ SampleCount
during the specified period. For
* more information, see Viewing resource
* recommendations in the Compute Optimizer User Guide. You can also get averaged utilization metric data
* for your resources using Amazon CloudWatch. For more information, see the Amazon CloudWatch
* User Guide.
*
* The Compute Optimizer API, Command Line Interface (CLI), and SDKs return utilization metrics using only
* the Maximum
statistic, which is the highest value observed during the specified period.
*
* The Compute Optimizer console displays graphs for some utilization metrics using the Average
* statistic, which is the value of Sum
/ SampleCount
during the specified period.
* For more information, see Viewing
* resource recommendations in the Compute Optimizer User Guide. You can also get averaged
* utilization metric data for your resources using Amazon CloudWatch. For more information, see the Amazon
* CloudWatch User Guide.
* @see ECSServiceMetricStatistic
*/
public String getStatistic() {
return this.statistic;
}
/**
*
* The statistic of the projected utilization metric. *
*
* The Compute Optimizer API, Command Line Interface (CLI), and SDKs return utilization metrics using only the
* Maximum
statistic, which is the highest value observed during the specified period.
*
* The Compute Optimizer console displays graphs for some utilization metrics using the Average
* statistic, which is the value of Sum
/ SampleCount
during the specified period. For
* more information, see Viewing resource
* recommendations in the Compute Optimizer User Guide. You can also get averaged utilization metric data
* for your resources using Amazon CloudWatch. For more information, see the Amazon CloudWatch
* User Guide.
*
* The Compute Optimizer API, Command Line Interface (CLI), and SDKs return utilization metrics using only
* the Maximum
statistic, which is the highest value observed during the specified period.
*
* The Compute Optimizer console displays graphs for some utilization metrics using the Average
* statistic, which is the value of Sum
/ SampleCount
during the specified period.
* For more information, see Viewing
* resource recommendations in the Compute Optimizer User Guide. You can also get averaged
* utilization metric data for your resources using Amazon CloudWatch. For more information, see the Amazon
* CloudWatch User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ECSServiceMetricStatistic
*/
public ECSServiceProjectedUtilizationMetric withStatistic(String statistic) {
setStatistic(statistic);
return this;
}
/**
*
* The statistic of the projected utilization metric. *
*
* The Compute Optimizer API, Command Line Interface (CLI), and SDKs return utilization metrics using only the
* Maximum
statistic, which is the highest value observed during the specified period.
*
* The Compute Optimizer console displays graphs for some utilization metrics using the Average
* statistic, which is the value of Sum
/ SampleCount
during the specified period. For
* more information, see Viewing resource
* recommendations in the Compute Optimizer User Guide. You can also get averaged utilization metric data
* for your resources using Amazon CloudWatch. For more information, see the Amazon CloudWatch
* User Guide.
*
* The Compute Optimizer API, Command Line Interface (CLI), and SDKs return utilization metrics using only
* the Maximum
statistic, which is the highest value observed during the specified period.
*
* The Compute Optimizer console displays graphs for some utilization metrics using the Average
* statistic, which is the value of Sum
/ SampleCount
during the specified period.
* For more information, see Viewing
* resource recommendations in the Compute Optimizer User Guide. You can also get averaged
* utilization metric data for your resources using Amazon CloudWatch. For more information, see the Amazon
* CloudWatch User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ECSServiceMetricStatistic
*/
public ECSServiceProjectedUtilizationMetric withStatistic(ECSServiceMetricStatistic statistic) {
this.statistic = statistic.toString();
return this;
}
/**
*
* The lower bound values for the projected utilization metrics. *
* * @param lowerBoundValue * The lower bound values for the projected utilization metrics. */ public void setLowerBoundValue(Double lowerBoundValue) { this.lowerBoundValue = lowerBoundValue; } /** ** The lower bound values for the projected utilization metrics. *
* * @return The lower bound values for the projected utilization metrics. */ public Double getLowerBoundValue() { return this.lowerBoundValue; } /** ** The lower bound values for the projected utilization metrics. *
* * @param lowerBoundValue * The lower bound values for the projected utilization metrics. * @return Returns a reference to this object so that method calls can be chained together. */ public ECSServiceProjectedUtilizationMetric withLowerBoundValue(Double lowerBoundValue) { setLowerBoundValue(lowerBoundValue); return this; } /** ** The upper bound values for the projected utilization metrics. *
* * @param upperBoundValue * The upper bound values for the projected utilization metrics. */ public void setUpperBoundValue(Double upperBoundValue) { this.upperBoundValue = upperBoundValue; } /** ** The upper bound values for the projected utilization metrics. *
* * @return The upper bound values for the projected utilization metrics. */ public Double getUpperBoundValue() { return this.upperBoundValue; } /** ** The upper bound values for the projected utilization metrics. *
* * @param upperBoundValue * The upper bound values for the projected utilization metrics. * @return Returns a reference to this object so that method calls can be chained together. */ public ECSServiceProjectedUtilizationMetric withUpperBoundValue(Double upperBoundValue) { setUpperBoundValue(upperBoundValue); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getStatistic() != null) sb.append("Statistic: ").append(getStatistic()).append(","); if (getLowerBoundValue() != null) sb.append("LowerBoundValue: ").append(getLowerBoundValue()).append(","); if (getUpperBoundValue() != null) sb.append("UpperBoundValue: ").append(getUpperBoundValue()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ECSServiceProjectedUtilizationMetric == false) return false; ECSServiceProjectedUtilizationMetric other = (ECSServiceProjectedUtilizationMetric) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getStatistic() == null ^ this.getStatistic() == null) return false; if (other.getStatistic() != null && other.getStatistic().equals(this.getStatistic()) == false) return false; if (other.getLowerBoundValue() == null ^ this.getLowerBoundValue() == null) return false; if (other.getLowerBoundValue() != null && other.getLowerBoundValue().equals(this.getLowerBoundValue()) == false) return false; if (other.getUpperBoundValue() == null ^ this.getUpperBoundValue() == null) return false; if (other.getUpperBoundValue() != null && other.getUpperBoundValue().equals(this.getUpperBoundValue()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getStatistic() == null) ? 0 : getStatistic().hashCode()); hashCode = prime * hashCode + ((getLowerBoundValue() == null) ? 0 : getLowerBoundValue().hashCode()); hashCode = prime * hashCode + ((getUpperBoundValue() == null) ? 0 : getUpperBoundValue().hashCode()); return hashCode; } @Override public ECSServiceProjectedUtilizationMetric clone() { try { return (ECSServiceProjectedUtilizationMetric) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.computeoptimizer.model.transform.ECSServiceProjectedUtilizationMetricMarshaller.getInstance().marshall(this, protocolMarshaller); } }