class MetricRule extends Message

Bind API methods to metrics. Binding a method to a metric causes that metric's configured quota, billing, and monitoring behaviors to apply to the method call.

Used by metric-based quotas only.

Protobuf type Google\Api\MetricRule

Methods

__construct()

No description

string
getSelector()

Selects the methods to which this rule applies.

setSelector(string $var)

Selects the methods to which this rule applies.

RepeatedField
getMetricCosts()

Metrics to update when the selected methods are called, and the associated cost applied to each metric.

setMetricCosts(array|RepeatedField $var)

Metrics to update when the selected methods are called, and the associated cost applied to each metric.

Details

at line 39
__construct()

at line 51
string getSelector()

Selects the methods to which this rule applies.

Refer to [selector][google.api.DocumentationRule.selector] for syntax details.

Generated from protobuf field string selector = 1;

Return Value

string

at line 63
setSelector(string $var)

Selects the methods to which this rule applies.

Refer to [selector][google.api.DocumentationRule.selector] for syntax details.

Generated from protobuf field string selector = 1;

Parameters

string $var

at line 79
RepeatedField getMetricCosts()

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.

Generated from protobuf field map<string, int64> metric_costs = 2;

Return Value

RepeatedField

at line 94
setMetricCosts(array|RepeatedField $var)

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.

Generated from protobuf field map<string, int64> metric_costs = 2;

Parameters

array|RepeatedField $var