public static final class AutoscalingMetricSpec.Builder extends com.google.protobuf.GeneratedMessage.Builder<AutoscalingMetricSpec.Builder> implements AutoscalingMetricSpecOrBuilder
The metric specification that defines the target resource utilization (CPU utilization, accelerator's duty cycle, and so on) for calculating the desired replica count.Protobuf type
google.cloud.aiplatform.v1beta1.AutoscalingMetricSpec| Modifier and Type | Method and Description |
|---|---|
AutoscalingMetricSpec |
build() |
AutoscalingMetricSpec |
buildPartial() |
AutoscalingMetricSpec.Builder |
clear() |
AutoscalingMetricSpec.Builder |
clearMetricName()
Required.
|
AutoscalingMetricSpec.Builder |
clearMonitoredResourceLabels() |
AutoscalingMetricSpec.Builder |
clearTarget()
The target resource utilization in percentage (1% - 100%) for the given
metric; once the real usage deviates from the target by a certain
percentage, the machine replicas change.
|
boolean |
containsMonitoredResourceLabels(String key)
Optional.
|
AutoscalingMetricSpec |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
String |
getMetricName()
Required.
|
com.google.protobuf.ByteString |
getMetricNameBytes()
Required.
|
Map<String,String> |
getMonitoredResourceLabels()
Deprecated.
|
int |
getMonitoredResourceLabelsCount()
Optional.
|
Map<String,String> |
getMonitoredResourceLabelsMap()
Optional.
|
String |
getMonitoredResourceLabelsOrDefault(String key,
String defaultValue)
Optional.
|
String |
getMonitoredResourceLabelsOrThrow(String key)
Optional.
|
Map<String,String> |
getMutableMonitoredResourceLabels()
Deprecated.
|
int |
getTarget()
The target resource utilization in percentage (1% - 100%) for the given
metric; once the real usage deviates from the target by a certain
percentage, the machine replicas change.
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable() |
protected com.google.protobuf.MapFieldReflectionAccessor |
internalGetMapFieldReflection(int number) |
protected com.google.protobuf.MapFieldReflectionAccessor |
internalGetMutableMapFieldReflection(int number) |
boolean |
isInitialized() |
AutoscalingMetricSpec.Builder |
mergeFrom(AutoscalingMetricSpec other) |
AutoscalingMetricSpec.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
AutoscalingMetricSpec.Builder |
mergeFrom(com.google.protobuf.Message other) |
AutoscalingMetricSpec.Builder |
putAllMonitoredResourceLabels(Map<String,String> values)
Optional.
|
AutoscalingMetricSpec.Builder |
putMonitoredResourceLabels(String key,
String value)
Optional.
|
AutoscalingMetricSpec.Builder |
removeMonitoredResourceLabels(String key)
Optional.
|
AutoscalingMetricSpec.Builder |
setMetricName(String value)
Required.
|
AutoscalingMetricSpec.Builder |
setMetricNameBytes(com.google.protobuf.ByteString value)
Required.
|
AutoscalingMetricSpec.Builder |
setTarget(int value)
The target resource utilization in percentage (1% - 100%) for the given
metric; once the real usage deviates from the target by a certain
percentage, the machine replicas change.
|
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneofpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<AutoscalingMetricSpec.Builder>protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
internalGetMutableMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<AutoscalingMetricSpec.Builder>protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<AutoscalingMetricSpec.Builder>public AutoscalingMetricSpec.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessage.Builder<AutoscalingMetricSpec.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<AutoscalingMetricSpec.Builder>public AutoscalingMetricSpec getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic AutoscalingMetricSpec build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic AutoscalingMetricSpec buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic AutoscalingMetricSpec.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<AutoscalingMetricSpec.Builder>public AutoscalingMetricSpec.Builder mergeFrom(AutoscalingMetricSpec other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessage.Builder<AutoscalingMetricSpec.Builder>public AutoscalingMetricSpec.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<AutoscalingMetricSpec.Builder>IOExceptionpublic String getMetricName()
Required. The resource metric name. Supported metrics: * For Online Prediction: * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` * `aiplatform.googleapis.com/prediction/online/cpu/utilization` * `aiplatform.googleapis.com/prediction/online/request_count`
string metric_name = 1 [(.google.api.field_behavior) = REQUIRED];getMetricName in interface AutoscalingMetricSpecOrBuilderpublic com.google.protobuf.ByteString getMetricNameBytes()
Required. The resource metric name. Supported metrics: * For Online Prediction: * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` * `aiplatform.googleapis.com/prediction/online/cpu/utilization` * `aiplatform.googleapis.com/prediction/online/request_count`
string metric_name = 1 [(.google.api.field_behavior) = REQUIRED];getMetricNameBytes in interface AutoscalingMetricSpecOrBuilderpublic AutoscalingMetricSpec.Builder setMetricName(String value)
Required. The resource metric name. Supported metrics: * For Online Prediction: * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` * `aiplatform.googleapis.com/prediction/online/cpu/utilization` * `aiplatform.googleapis.com/prediction/online/request_count`
string metric_name = 1 [(.google.api.field_behavior) = REQUIRED];value - The metricName to set.public AutoscalingMetricSpec.Builder clearMetricName()
Required. The resource metric name. Supported metrics: * For Online Prediction: * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` * `aiplatform.googleapis.com/prediction/online/cpu/utilization` * `aiplatform.googleapis.com/prediction/online/request_count`
string metric_name = 1 [(.google.api.field_behavior) = REQUIRED];public AutoscalingMetricSpec.Builder setMetricNameBytes(com.google.protobuf.ByteString value)
Required. The resource metric name. Supported metrics: * For Online Prediction: * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` * `aiplatform.googleapis.com/prediction/online/cpu/utilization` * `aiplatform.googleapis.com/prediction/online/request_count`
string metric_name = 1 [(.google.api.field_behavior) = REQUIRED];value - The bytes for metricName to set.public int getTarget()
The target resource utilization in percentage (1% - 100%) for the given metric; once the real usage deviates from the target by a certain percentage, the machine replicas change. The default value is 60 (representing 60%) if not provided.
int32 target = 2;getTarget in interface AutoscalingMetricSpecOrBuilderpublic AutoscalingMetricSpec.Builder setTarget(int value)
The target resource utilization in percentage (1% - 100%) for the given metric; once the real usage deviates from the target by a certain percentage, the machine replicas change. The default value is 60 (representing 60%) if not provided.
int32 target = 2;value - The target to set.public AutoscalingMetricSpec.Builder clearTarget()
The target resource utilization in percentage (1% - 100%) for the given metric; once the real usage deviates from the target by a certain percentage, the machine replicas change. The default value is 60 (representing 60%) if not provided.
int32 target = 2;public int getMonitoredResourceLabelsCount()
AutoscalingMetricSpecOrBuilderOptional. The Cloud Monitoring monitored resource labels as key value pairs used for metrics filtering. See Cloud Monitoring Labels https://cloud.google.com/monitoring/api/v3/metric-model#generic-label-info
map<string, string> monitored_resource_labels = 3 [(.google.api.field_behavior) = OPTIONAL];
getMonitoredResourceLabelsCount in interface AutoscalingMetricSpecOrBuilderpublic boolean containsMonitoredResourceLabels(String key)
Optional. The Cloud Monitoring monitored resource labels as key value pairs used for metrics filtering. See Cloud Monitoring Labels https://cloud.google.com/monitoring/api/v3/metric-model#generic-label-info
map<string, string> monitored_resource_labels = 3 [(.google.api.field_behavior) = OPTIONAL];
containsMonitoredResourceLabels in interface AutoscalingMetricSpecOrBuilder@Deprecated public Map<String,String> getMonitoredResourceLabels()
getMonitoredResourceLabelsMap() instead.getMonitoredResourceLabels in interface AutoscalingMetricSpecOrBuilderpublic Map<String,String> getMonitoredResourceLabelsMap()
Optional. The Cloud Monitoring monitored resource labels as key value pairs used for metrics filtering. See Cloud Monitoring Labels https://cloud.google.com/monitoring/api/v3/metric-model#generic-label-info
map<string, string> monitored_resource_labels = 3 [(.google.api.field_behavior) = OPTIONAL];
getMonitoredResourceLabelsMap in interface AutoscalingMetricSpecOrBuilderpublic String getMonitoredResourceLabelsOrDefault(String key, String defaultValue)
Optional. The Cloud Monitoring monitored resource labels as key value pairs used for metrics filtering. See Cloud Monitoring Labels https://cloud.google.com/monitoring/api/v3/metric-model#generic-label-info
map<string, string> monitored_resource_labels = 3 [(.google.api.field_behavior) = OPTIONAL];
getMonitoredResourceLabelsOrDefault in interface AutoscalingMetricSpecOrBuilderpublic String getMonitoredResourceLabelsOrThrow(String key)
Optional. The Cloud Monitoring monitored resource labels as key value pairs used for metrics filtering. See Cloud Monitoring Labels https://cloud.google.com/monitoring/api/v3/metric-model#generic-label-info
map<string, string> monitored_resource_labels = 3 [(.google.api.field_behavior) = OPTIONAL];
getMonitoredResourceLabelsOrThrow in interface AutoscalingMetricSpecOrBuilderpublic AutoscalingMetricSpec.Builder clearMonitoredResourceLabels()
public AutoscalingMetricSpec.Builder removeMonitoredResourceLabels(String key)
Optional. The Cloud Monitoring monitored resource labels as key value pairs used for metrics filtering. See Cloud Monitoring Labels https://cloud.google.com/monitoring/api/v3/metric-model#generic-label-info
map<string, string> monitored_resource_labels = 3 [(.google.api.field_behavior) = OPTIONAL];
@Deprecated public Map<String,String> getMutableMonitoredResourceLabels()
public AutoscalingMetricSpec.Builder putMonitoredResourceLabels(String key, String value)
Optional. The Cloud Monitoring monitored resource labels as key value pairs used for metrics filtering. See Cloud Monitoring Labels https://cloud.google.com/monitoring/api/v3/metric-model#generic-label-info
map<string, string> monitored_resource_labels = 3 [(.google.api.field_behavior) = OPTIONAL];
public AutoscalingMetricSpec.Builder putAllMonitoredResourceLabels(Map<String,String> values)
Optional. The Cloud Monitoring monitored resource labels as key value pairs used for metrics filtering. See Cloud Monitoring Labels https://cloud.google.com/monitoring/api/v3/metric-model#generic-label-info
map<string, string> monitored_resource_labels = 3 [(.google.api.field_behavior) = OPTIONAL];
Copyright © 2026 Google LLC. All rights reserved.