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.

Generated from protobuf message google.api.MetricRule

Methods

__construct()

No description

string
getSelector()

Selects the methods to which this rule applies.

$this
setSelector(string $var)

Selects the methods to which this rule applies.

MapField
getMetricCosts()

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

$this
setMetricCosts(array|MapField $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 64
$this 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

Return Value

$this

at line 82
MapField 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

MapField

at line 98
$this setMetricCosts(array|MapField $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|MapField $var

Return Value

$this