Metrics to update when the selected methods are called, and the associated
cost applied to each metric.
The key of the map is the metric name, and the values are the amount
increased for the metric against which the quota limits are defined.
The value must not be negative.
Metrics to update when the selected methods are called, and the associated
cost applied to each metric.
The key of the map is the metric name, and the values are the amount
increased for the metric against which the quota limits are defined.
The value must not be negative.
Metrics to update when the selected methods are called, and the associated
cost applied to each metric.
The key of the map is the metric name, and the values are the amount
increased for the metric against which the quota limits are defined.
The value must not be negative.
Metrics to update when the selected methods are called, and the associated
cost applied to each metric.
The key of the map is the metric name, and the values are the amount
increased for the metric against which the quota limits are defined.
The value must not be negative.
Metrics to update when the selected methods are called, and the associated
cost applied to each metric.
The key of the map is the metric name, and the values are the amount
increased for the metric against which the quota limits are defined.
The value must not be negative.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Interface MetricRuleOrBuilder (2.60.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.60.0 (latest)](/java/docs/reference/proto-google-common-protos/latest/com.google.api.MetricRuleOrBuilder)\n- [2.59.2](/java/docs/reference/proto-google-common-protos/2.59.2/com.google.api.MetricRuleOrBuilder)\n- [2.58.0](/java/docs/reference/proto-google-common-protos/2.58.0/com.google.api.MetricRuleOrBuilder)\n- [2.57.0](/java/docs/reference/proto-google-common-protos/2.57.0/com.google.api.MetricRuleOrBuilder)\n- [2.56.0](/java/docs/reference/proto-google-common-protos/2.56.0/com.google.api.MetricRuleOrBuilder)\n- [2.54.1](/java/docs/reference/proto-google-common-protos/2.54.1/com.google.api.MetricRuleOrBuilder)\n- [2.53.0](/java/docs/reference/proto-google-common-protos/2.53.0/com.google.api.MetricRuleOrBuilder)\n- [2.52.0](/java/docs/reference/proto-google-common-protos/2.52.0/com.google.api.MetricRuleOrBuilder)\n- [2.51.0](/java/docs/reference/proto-google-common-protos/2.51.0/com.google.api.MetricRuleOrBuilder)\n- [2.50.1](/java/docs/reference/proto-google-common-protos/2.50.1/com.google.api.MetricRuleOrBuilder)\n- [2.49.0](/java/docs/reference/proto-google-common-protos/2.49.0/com.google.api.MetricRuleOrBuilder)\n- [2.48.0](/java/docs/reference/proto-google-common-protos/2.48.0/com.google.api.MetricRuleOrBuilder)\n- [2.46.0](/java/docs/reference/proto-google-common-protos/2.46.0/com.google.api.MetricRuleOrBuilder)\n- [2.45.1](/java/docs/reference/proto-google-common-protos/2.45.1/com.google.api.MetricRuleOrBuilder)\n- [2.44.0](/java/docs/reference/proto-google-common-protos/2.44.0/com.google.api.MetricRuleOrBuilder)\n- [2.43.0](/java/docs/reference/proto-google-common-protos/2.43.0/com.google.api.MetricRuleOrBuilder)\n- [2.42.0](/java/docs/reference/proto-google-common-protos/2.42.0/com.google.api.MetricRuleOrBuilder)\n- [2.41.0](/java/docs/reference/proto-google-common-protos/2.41.0/com.google.api.MetricRuleOrBuilder)\n- [2.40.0](/java/docs/reference/proto-google-common-protos/2.40.0/com.google.api.MetricRuleOrBuilder)\n- [2.39.1](/java/docs/reference/proto-google-common-protos/2.39.1/com.google.api.MetricRuleOrBuilder)\n- [2.38.0](/java/docs/reference/proto-google-common-protos/2.38.0/com.google.api.MetricRuleOrBuilder)\n- [2.37.1](/java/docs/reference/proto-google-common-protos/2.37.1/com.google.api.MetricRuleOrBuilder)\n- [2.36.0](/java/docs/reference/proto-google-common-protos/2.36.0/com.google.api.MetricRuleOrBuilder)\n- [2.34.0](/java/docs/reference/proto-google-common-protos/2.34.0/com.google.api.MetricRuleOrBuilder)\n- [2.33.0](/java/docs/reference/proto-google-common-protos/2.33.0/com.google.api.MetricRuleOrBuilder)\n- [2.32.0](/java/docs/reference/proto-google-common-protos/2.32.0/com.google.api.MetricRuleOrBuilder)\n- [2.30.0](/java/docs/reference/proto-google-common-protos/2.30.0/com.google.api.MetricRuleOrBuilder)\n- [2.29.0](/java/docs/reference/proto-google-common-protos/2.29.0/com.google.api.MetricRuleOrBuilder)\n- [2.28.0](/java/docs/reference/proto-google-common-protos/2.28.0/com.google.api.MetricRuleOrBuilder)\n- [2.27.0](/java/docs/reference/proto-google-common-protos/2.27.0/com.google.api.MetricRuleOrBuilder)\n- [2.26.0](/java/docs/reference/proto-google-common-protos/2.26.0/com.google.api.MetricRuleOrBuilder)\n- [2.25.1](/java/docs/reference/proto-google-common-protos/2.25.1/com.google.api.MetricRuleOrBuilder)\n- [2.24.0](/java/docs/reference/proto-google-common-protos/2.24.0/com.google.api.MetricRuleOrBuilder)\n- [2.23.1](/java/docs/reference/proto-google-common-protos/2.23.1/com.google.api.MetricRuleOrBuilder)\n- [2.22.1](/java/docs/reference/proto-google-common-protos/2.22.1/com.google.api.MetricRuleOrBuilder)\n- [2.21.1](/java/docs/reference/proto-google-common-protos/2.21.1/com.google.api.MetricRuleOrBuilder)\n- [2.15.0](/java/docs/reference/proto-google-common-protos/2.15.0/com.google.api.MetricRuleOrBuilder)\n- [2.14.3](/java/docs/reference/proto-google-common-protos/2.14.3/com.google.api.MetricRuleOrBuilder)\n- [2.13.0](/java/docs/reference/proto-google-common-protos/2.13.0/com.google.api.MetricRuleOrBuilder)\n- [2.12.0](/java/docs/reference/proto-google-common-protos/2.12.0/com.google.api.MetricRuleOrBuilder)\n- [2.11.0](/java/docs/reference/proto-google-common-protos/2.11.0/com.google.api.MetricRuleOrBuilder)\n- [2.10.0](/java/docs/reference/proto-google-common-protos/2.10.0/com.google.api.MetricRuleOrBuilder)\n- [2.9.6](/java/docs/reference/proto-google-common-protos/2.9.6/com.google.api.MetricRuleOrBuilder)\n- [2.8.4](/java/docs/reference/proto-google-common-protos/2.8.4/com.google.api.MetricRuleOrBuilder)\n- [2.7.4](/java/docs/reference/proto-google-common-protos/2.7.4/com.google.api.MetricRuleOrBuilder) \n\n public interface MetricRuleOrBuilder extends MessageOrBuilder\n\nImplements\n----------\n\n[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)\n\nMethods\n-------\n\n### containsMetricCosts(String key)\n\n public abstract boolean containsMetricCosts(String key)\n\nMetrics to update when the selected methods are called, and the associated\ncost applied to each metric.\n\nThe key of the map is the metric name, and the values are the amount\nincreased for the metric against which the quota limits are defined.\nThe value must not be negative.\n\n`map\u003cstring, int64\u003e metric_costs = 2;`\n\n### getMetricCosts() (deprecated)\n\n public abstract Map\u003cString,Long\u003e getMetricCosts()\n\nUse [#getMetricCostsMap()](/java/docs/reference/proto-google-common-protos/latest/com.google.api.MetricRuleOrBuilder#com_google_api_MetricRuleOrBuilder_getMetricCostsMap__) instead.\n\n### getMetricCostsCount()\n\n public abstract int getMetricCostsCount()\n\nMetrics to update when the selected methods are called, and the associated\ncost applied to each metric.\n\nThe key of the map is the metric name, and the values are the amount\nincreased for the metric against which the quota limits are defined.\nThe value must not be negative.\n\n`map\u003cstring, int64\u003e metric_costs = 2;`\n\n### getMetricCostsMap()\n\n public abstract Map\u003cString,Long\u003e getMetricCostsMap()\n\nMetrics to update when the selected methods are called, and the associated\ncost applied to each metric.\n\nThe key of the map is the metric name, and the values are the amount\nincreased for the metric against which the quota limits are defined.\nThe value must not be negative.\n\n`map\u003cstring, int64\u003e metric_costs = 2;`\n\n### getMetricCostsOrDefault(String key, long defaultValue)\n\n public abstract long getMetricCostsOrDefault(String key, long defaultValue)\n\nMetrics to update when the selected methods are called, and the associated\ncost applied to each metric.\n\nThe key of the map is the metric name, and the values are the amount\nincreased for the metric against which the quota limits are defined.\nThe value must not be negative.\n\n`map\u003cstring, int64\u003e metric_costs = 2;`\n\n### getMetricCostsOrThrow(String key)\n\n public abstract long getMetricCostsOrThrow(String key)\n\nMetrics to update when the selected methods are called, and the associated\ncost applied to each metric.\n\nThe key of the map is the metric name, and the values are the amount\nincreased for the metric against which the quota limits are defined.\nThe value must not be negative.\n\n`map\u003cstring, int64\u003e metric_costs = 2;`\n\n### getSelector()\n\n public abstract String getSelector()\n\nSelects the methods to which this rule applies.\n\nRefer to selector for syntax\ndetails.\n\n`string selector = 1;`\n\n### getSelectorBytes()\n\n public abstract ByteString getSelectorBytes()\n\nSelects the methods to which this rule applies.\n\nRefer to selector for syntax\ndetails.\n\n`string selector = 1;`"]]