/* * 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 utilization metric of an Amazon ECS service. *
** 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 ECSServiceUtilizationMetric implements Serializable, Cloneable, StructuredPojo { /** ** The name of the utilization metric. *
** The following utilization metrics are available: *
*
* Cpu
— The amount of CPU capacity that's used in the service.
*
* Memory
— The amount of memory that's used in the service.
*
* The statistic of the 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 value of the utilization metric. *
*/ private Double value; /** ** The name of the utilization metric. *
** The following utilization metrics are available: *
*
* Cpu
— The amount of CPU capacity that's used in the service.
*
* Memory
— The amount of memory that's used in the service.
*
* The following utilization metrics are available: *
*
* Cpu
— The amount of CPU capacity that's used in the service.
*
* Memory
— The amount of memory that's used in the service.
*
* The name of the utilization metric. *
** The following utilization metrics are available: *
*
* Cpu
— The amount of CPU capacity that's used in the service.
*
* Memory
— The amount of memory that's used in the service.
*
* The following utilization metrics are available: *
*
* Cpu
— The amount of CPU capacity that's used in the service.
*
* Memory
— The amount of memory that's used in the service.
*
* The name of the utilization metric. *
** The following utilization metrics are available: *
*
* Cpu
— The amount of CPU capacity that's used in the service.
*
* Memory
— The amount of memory that's used in the service.
*
* The following utilization metrics are available: *
*
* Cpu
— The amount of CPU capacity that's used in the service.
*
* Memory
— The amount of memory that's used in the service.
*
* The name of the utilization metric. *
** The following utilization metrics are available: *
*
* Cpu
— The amount of CPU capacity that's used in the service.
*
* Memory
— The amount of memory that's used in the service.
*
* The following utilization metrics are available: *
*
* Cpu
— The amount of CPU capacity that's used in the service.
*
* Memory
— The amount of memory that's used in the service.
*
* The statistic of the 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 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 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 ECSServiceUtilizationMetric withStatistic(String statistic) {
setStatistic(statistic);
return this;
}
/**
*
* The statistic of the 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 ECSServiceUtilizationMetric withStatistic(ECSServiceMetricStatistic statistic) {
this.statistic = statistic.toString();
return this;
}
/**
*
* The value of the utilization metric. *
* * @param value * The value of the utilization metric. */ public void setValue(Double value) { this.value = value; } /** ** The value of the utilization metric. *
* * @return The value of the utilization metric. */ public Double getValue() { return this.value; } /** ** The value of the utilization metric. *
* * @param value * The value of the utilization metric. * @return Returns a reference to this object so that method calls can be chained together. */ public ECSServiceUtilizationMetric withValue(Double value) { setValue(value); 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 (getValue() != null) sb.append("Value: ").append(getValue()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ECSServiceUtilizationMetric == false) return false; ECSServiceUtilizationMetric other = (ECSServiceUtilizationMetric) 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.getValue() == null ^ this.getValue() == null) return false; if (other.getValue() != null && other.getValue().equals(this.getValue()) == 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 + ((getValue() == null) ? 0 : getValue().hashCode()); return hashCode; } @Override public ECSServiceUtilizationMetric clone() { try { return (ECSServiceUtilizationMetric) 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.ECSServiceUtilizationMetricMarshaller.getInstance().marshall(this, protocolMarshaller); } }