# Google Cloud Database Center V1beta Client - Class QueryMetrics (0.7.0)

0.7.0 (latest) 0.6.0 0.5.0 0.4.1 0.3.1 0.2.0 0.1.0

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Google Cloud Database Center V1beta Client class QueryMetrics.

QueryMetrics contains the metrics related to the query execution.

Generated from protobuf message `google.cloud.databasecenter.v1beta.QueryMetrics`

## Namespace

Google \\ Cloud \\ DatabaseCenter \\ V1beta

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ execution_count` | `int|string` The number of times the query was executed. |
| `↳ avg_cpu_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` The average execution period of the query across all runs. |
| `↳ total_cpu_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Duration` The total CPU time consumed by the query across all runs. |
| `↳ rows_processed` | `int|string` The average number of rows processed by the query across all runs. |
| `↳ metrics_window` | `int` The window over which the metrics are aggregated. |

### getExecutionCount

The number of times the query was executed.

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

### setExecutionCount

The number of times the query was executed.

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

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

### getAvgCpuTime

The average execution period of the query across all runs.

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

### hasAvgCpuTime

### clearAvgCpuTime

### setAvgCpuTime

The average execution period of the query across all runs.

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

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

### getTotalCpuTime

The total CPU time consumed by the query across all runs.

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

### hasTotalCpuTime

### clearTotalCpuTime

### setTotalCpuTime

The total CPU time consumed by the query across all runs.

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

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

### getRowsProcessed

The average number of rows processed by the query across all runs.

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

### setRowsProcessed

The average number of rows processed by the query across all runs.

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

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

### getMetricsWindow

The window over which the metrics are aggregated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [MetricsWindow](https://docs.cloud.google.com/php/docs/reference/cloud-databasecenter/latest/V1beta.QueryMetrics.MetricsWindow). |

### setMetricsWindow

The window over which the metrics are aggregated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [MetricsWindow](https://docs.cloud.google.com/php/docs/reference/cloud-databasecenter/latest/V1beta.QueryMetrics.MetricsWindow). |

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