Class Metric
- java.lang.Object
-
- software.amazon.jsii.JsiiObject
-
- org.cdk8s.plus25.Metric
-
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.88.0 (build eaabd08)", date="2023-09-11T06:17:58.345Z") @Stability(Stable) public class Metric extends software.amazon.jsii.JsiiObject
A metric condition that HorizontalPodAutoscaler's scale on.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MetriccontainerCpu(MetricContainerResourceOptions options)Metric that tracks the CPU of a container.static MetriccontainerEphemeralStorage(MetricContainerResourceOptions options)Metric that tracks the local ephemeral storage of a container.static MetriccontainerMemory(MetricContainerResourceOptions options)Metric that tracks the Memory of a container.static MetriccontainerStorage(MetricContainerResourceOptions options)Metric that tracks the volume size of a container.static Metricexternal(MetricOptions options)A global metric that is not associated with any Kubernetes object.StringgetType()static Metricobject(MetricObjectOptions options)Metric that describes a metric of a kubernetes object.static Metricpods(MetricOptions options)A pod metric that will be averaged across all pods of the current scale target.static MetricresourceCpu(MetricTarget target)Tracks the available CPU of the pods in a target.static MetricresourceEphemeralStorage(MetricTarget target)Tracks the available Ephemeral Storage of the pods in a target.static MetricresourceMemory(MetricTarget target)Tracks the available Memory of the pods in a target.static MetricresourceStorage(MetricTarget target)Tracks the available Storage of the pods in a target.-
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
-
-
-
-
Method Detail
-
containerCpu
@Stability(Stable) @NotNull public static Metric containerCpu(@NotNull MetricContainerResourceOptions options)
Metric that tracks the CPU of a container.This metric will be tracked across all pods of the current scale target.
- Parameters:
options- This parameter is required.
-
containerEphemeralStorage
@Stability(Stable) @NotNull public static Metric containerEphemeralStorage(@NotNull MetricContainerResourceOptions options)
Metric that tracks the local ephemeral storage of a container.This metric will be tracked across all pods of the current scale target.
- Parameters:
options- This parameter is required.
-
containerMemory
@Stability(Stable) @NotNull public static Metric containerMemory(@NotNull MetricContainerResourceOptions options)
Metric that tracks the Memory of a container.This metric will be tracked across all pods of the current scale target.
- Parameters:
options- This parameter is required.
-
containerStorage
@Stability(Stable) @NotNull public static Metric containerStorage(@NotNull MetricContainerResourceOptions options)
Metric that tracks the volume size of a container.This metric will be tracked across all pods of the current scale target.
- Parameters:
options- This parameter is required.
-
external
@Stability(Stable) @NotNull public static Metric external(@NotNull MetricOptions options)
A global metric that is not associated with any Kubernetes object.Allows for autoscaling based on information coming from components running outside of the cluster.
Use case:
- Scale up when the length of an SQS queue is greater than 10 messages.
- Scale down when an outside load balancer's queries are less than 10000 per second.
- Parameters:
options- This parameter is required.
-
object
@Stability(Stable) @NotNull public static Metric object(@NotNull MetricObjectOptions options)
Metric that describes a metric of a kubernetes object.Use case:
- Scale on a Kubernetes Ingress's hits-per-second metric.
- Parameters:
options- This parameter is required.
-
pods
@Stability(Stable) @NotNull public static Metric pods(@NotNull MetricOptions options)
A pod metric that will be averaged across all pods of the current scale target.Use case:
- Average CPU utilization across all pods
- Transactions processed per second across all pods
- Parameters:
options- This parameter is required.
-
resourceCpu
@Stability(Stable) @NotNull public static Metric resourceCpu(@NotNull MetricTarget target)
Tracks the available CPU of the pods in a target.Note: Since the resource usages of all the containers are summed up the total pod utilization may not accurately represent the individual container resource usage. This could lead to situations where a single container might be running with high usage and the HPA will not scale out because the overall pod usage is still within acceptable limits.
Use case:
- Scale up when CPU is above 40%.
- Parameters:
target- This parameter is required.
-
resourceEphemeralStorage
@Stability(Stable) @NotNull public static Metric resourceEphemeralStorage(@NotNull MetricTarget target)
Tracks the available Ephemeral Storage of the pods in a target.Note: Since the resource usages of all the containers are summed up the total pod utilization may not accurately represent the individual container resource usage. This could lead to situations where a single container might be running with high usage and the HPA will not scale out because the overall pod usage is still within acceptable limits.
- Parameters:
target- This parameter is required.
-
resourceMemory
@Stability(Stable) @NotNull public static Metric resourceMemory(@NotNull MetricTarget target)
Tracks the available Memory of the pods in a target.Note: Since the resource usages of all the containers are summed up the total pod utilization may not accurately represent the individual container resource usage. This could lead to situations where a single container might be running with high usage and the HPA will not scale out because the overall pod usage is still within acceptable limits.
Use case:
- Scale up when Memory is above 512MB.
- Parameters:
target- This parameter is required.
-
resourceStorage
@Stability(Stable) @NotNull public static Metric resourceStorage(@NotNull MetricTarget target)
Tracks the available Storage of the pods in a target.Note: Since the resource usages of all the containers are summed up the total pod utilization may not accurately represent the individual container resource usage. This could lead to situations where a single container might be running with high usage and the HPA will not scale out because the overall pod usage is still within acceptable limits.
- Parameters:
target- This parameter is required.
-
getType
@Stability(Stable) @NotNull public String getType()
-
-