# Service Control v1 API - Class MetricValue (2.5.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.5.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.MetricValue)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.4.0/Google.Cloud.ServiceControl.V1.MetricValue)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.3.0/Google.Cloud.ServiceControl.V1.MetricValue)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.2.0/Google.Cloud.ServiceControl.V1.MetricValue)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.1.0/Google.Cloud.ServiceControl.V1.MetricValue)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/2.0.0/Google.Cloud.ServiceControl.V1.MetricValue)
- [1.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.4.0/Google.Cloud.ServiceControl.V1.MetricValue)
- [1.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.3.0/Google.Cloud.ServiceControl.V1.MetricValue)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.2.0/Google.Cloud.ServiceControl.V1.MetricValue)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.1.0/Google.Cloud.ServiceControl.V1.MetricValue)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/1.0.0/Google.Cloud.ServiceControl.V1.MetricValue)

    public sealed class MetricValue : IMessage<MetricValue>, IEquatable<MetricValue>, IDeepCloneable<MetricValue>, IBufferMessage, IMessage

Reference documentation and code samples for the Service Control v1 API class MetricValue.

Represents a single metric value.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> MetricValue

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[MetricValue](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.MetricValue), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[MetricValue](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.MetricValue), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[MetricValue](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.MetricValue), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.ServiceControl.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1)

## Assembly

Google.Cloud.ServiceControl.V1.dll

## Constructors

### MetricValue()

    public MetricValue()

### MetricValue(MetricValue)

    public MetricValue(MetricValue other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.MetricValue` |

## Properties

### BoolValue

    public bool BoolValue { get; set; }

A boolean value.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### DistributionValue

    public Distribution DistributionValue { get; set; }

A distribution value.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.Distribution` |   |

### DoubleValue

    public double DoubleValue { get; set; }

A double precision floating point value.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.double` |   |

### EndTime

    public Timestamp EndTime { get; set; }

The end of the time period over which this metric value's measurement
applies. If not specified,
\[google.api.servicecontrol.v1.Operation.end_time\]\[google.api.servicecontrol.v1.Operation.end_time\] will be used.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Timestamp.html` |   |

### HasBoolValue

    public bool HasBoolValue { get; }

Gets whether the "bool_value" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasDoubleValue

    public bool HasDoubleValue { get; }

Gets whether the "double_value" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasInt64Value

    public bool HasInt64Value { get; }

Gets whether the "int64_value" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasStringValue

    public bool HasStringValue { get; }

Gets whether the "string_value" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### Int64Value

    public long Int64Value { get; set; }

A signed 64-bit integer value.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int64` |   |

### Labels

    public MapField<string, string> Labels { get; }

The labels describing the metric value.
See comments on \[google.api.servicecontrol.v1.Operation.labels\]\[google.api.servicecontrol.v1.Operation.labels\] for
the overriding relationship.
Note that this map must not contain monitored resource labels.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.MapField-2.htmlhttps://learn.microsoft.com/dotnet/api/system.stringhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### StartTime

    public Timestamp StartTime { get; set; }

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\]\[google.api.servicecontrol.v1.Operation.start_time\] will be used.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Timestamp.html` |   |

### StringValue

    public string StringValue { get; set; }

A text string value.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ValueCase

    public MetricValue.ValueOneofCase ValueCase { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.MetricValuehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ServiceControl.V1/latest/Google.Cloud.ServiceControl.V1.MetricValue.ValueOneofCase` |   |