# Google Cloud Service Control V1 Client - Class MetricValue (2.2.0)

2.2.0 (latest) 2.1.1 2.0.4 1.4.4 1.3.0 1.2.1 1.1.1 1.0.6 Reference documentation and code samples for the Google Cloud Service Control V1 Client class MetricValue.

Represents a single metric value.

Generated from protobuf message `google.api.servicecontrol.v1.MetricValue`

## Namespace

Google \\ Cloud \\ ServiceControl \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` The labels describing the metric value. See comments on [google.api.servicecontrol.v1.Operation.labels](https://docs.cloud.google.com/php/docs/reference/cloud-service-control/latest/V1.Operation#_Google_Cloud_ServiceControl_V1_Operation__getLabels__) for the overriding relationship. Note that this map must not contain monitored resource labels. |
| `↳ start_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` The start of the time period over which this metric value's measurement applies. The time period has different semantics for different metric types (cumulative, delta, and gauge). See the metric definition documentation in the service configuration for details. If not specified, [google.api.servicecontrol.v1.Operation.start_time](https://docs.cloud.google.com/php/docs/reference/cloud-service-control/latest/V1.Operation#_Google_Cloud_ServiceControl_V1_Operation__getStartTime__) will be used. |
| `↳ end_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` The end of the time period over which this metric value's measurement applies. If not specified, [google.api.servicecontrol.v1.Operation.end_time](https://docs.cloud.google.com/php/docs/reference/cloud-service-control/latest/V1.Operation#_Google_Cloud_ServiceControl_V1_Operation__getEndTime__) will be used. |
| `↳ bool_value` | `bool` A boolean value. |
| `↳ int64_value` | `int|string` A signed 64-bit integer value. |
| `↳ double_value` | `float` A double precision floating point value. |
| `↳ string_value` | `string` A text string value. |
| `↳ distribution_value` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-control/latest/V1.Distribution` A distribution value. |

### getLabels

The labels describing the metric value.

See comments on [google.api.servicecontrol.v1.Operation.labels](https://docs.cloud.google.com/php/docs/reference/cloud-service-control/latest/V1.Operation#_Google_Cloud_ServiceControl_V1_Operation__getLabels__) for
the overriding relationship.
Note that this map must not contain monitored resource labels.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

The labels describing the metric value.

See comments on [google.api.servicecontrol.v1.Operation.labels](https://docs.cloud.google.com/php/docs/reference/cloud-service-control/latest/V1.Operation#_Google_Cloud_ServiceControl_V1_Operation__getLabels__) for
the overriding relationship.
Note that this map must not contain monitored resource labels.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getStartTime

The start of the time period over which this metric value's measurement
applies. The time period has different semantics for different metric
types (cumulative, delta, and gauge). See the metric definition
documentation in the service configuration for details. If not specified,
[google.api.servicecontrol.v1.Operation.start_time](https://docs.cloud.google.com/php/docs/reference/cloud-service-control/latest/V1.Operation#_Google_Cloud_ServiceControl_V1_Operation__getStartTime__) will be used.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasStartTime

### clearStartTime

### setStartTime

The start of the time period over which this metric value's measurement
applies. The time period has different semantics for different metric
types (cumulative, delta, and gauge). See the metric definition
documentation in the service configuration for details. If not specified,
[google.api.servicecontrol.v1.Operation.start_time](https://docs.cloud.google.com/php/docs/reference/cloud-service-control/latest/V1.Operation#_Google_Cloud_ServiceControl_V1_Operation__getStartTime__) will be used.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEndTime

The end of the time period over which this metric value's measurement
applies. If not specified,
[google.api.servicecontrol.v1.Operation.end_time](https://docs.cloud.google.com/php/docs/reference/cloud-service-control/latest/V1.Operation#_Google_Cloud_ServiceControl_V1_Operation__getEndTime__) will be used.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasEndTime

### clearEndTime

### setEndTime

The end of the time period over which this metric value's measurement
applies. If not specified,
[google.api.servicecontrol.v1.Operation.end_time](https://docs.cloud.google.com/php/docs/reference/cloud-service-control/latest/V1.Operation#_Google_Cloud_ServiceControl_V1_Operation__getEndTime__) will be used.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getBoolValue

A boolean value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### hasBoolValue

### setBoolValue

A boolean value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getInt64Value

A signed 64-bit integer value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|string` |   |

### hasInt64Value

### setInt64Value

A signed 64-bit integer value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDoubleValue

A double precision floating point value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### hasDoubleValue

### setDoubleValue

A double precision floating point value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getStringValue

A text string value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### hasStringValue

### setStringValue

A text string value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDistributionValue

A distribution value.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-service-control/latest/V1.Distribution|null` |   |

### hasDistributionValue

### setDistributionValue

A distribution value.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-control/latest/V1.Distribution` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getValue

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |