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,["# Google API Common Protos Client - Class MetricRule (4.12.3)\n\nVersion latestkeyboard_arrow_down\n\n- [4.12.3 (latest)](/php/docs/reference/common-protos/latest/Api.MetricRule)\n- [4.12.2](/php/docs/reference/common-protos/4.12.2/Api.MetricRule)\n- [4.11.0](/php/docs/reference/common-protos/4.11.0/Api.MetricRule)\n- [4.10.0](/php/docs/reference/common-protos/4.10.0/Api.MetricRule)\n- [4.9.0](/php/docs/reference/common-protos/4.9.0/Api.MetricRule)\n- [4.8.3](/php/docs/reference/common-protos/4.8.3/Api.MetricRule) \nReference documentation and code samples for the Google API Common Protos Client class MetricRule.\n\nBind API methods to metrics. Binding a method to a metric causes that\nmetric's configured quota behaviors to apply to the method call.\n\nGenerated from protobuf message `google.api.MetricRule`\n\nNamespace\n---------\n\nGoogle \\\\ Api\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getSelector\n\nSelects the methods to which this rule applies.\n\nRefer to [selector](/php/docs/reference/common-protos/latest/Api.DocumentationRule#_Google_Api_DocumentationRule__getSelector__) for syntax\ndetails.\n\n### setSelector\n\nSelects the methods to which this rule applies.\n\nRefer to [selector](/php/docs/reference/common-protos/latest/Api.DocumentationRule#_Google_Api_DocumentationRule__getSelector__) for syntax\ndetails.\n\n### getMetricCosts\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### setMetricCosts\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."]]