Databases - List Metrics
Returns database metrics.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics?api-version=2014-04-01&$filter={$filter}
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
database
|
path | True |
string |
The name of the database. |
|
resource
|
path | True |
string |
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
|
server
|
path | True |
string |
The name of the server. |
|
subscription
|
path | True |
string |
The subscription ID that identifies an Azure subscription. |
|
$filter
|
query | True |
string |
An OData filter expression that describes a subset of metrics to return. |
|
api-version
|
query | True |
string |
The API version to use for the request. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
OK |
Examples
List database usage metrics
Sample request
GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-6730/providers/Microsoft.Sql/servers/sqlcrudtest-9007/databases/3481/metrics?api-version=2014-04-01&$filter=name/value eq 'cpu_percent' and timeGrain eq '00:10:00' and startTime eq '2017-06-02T18:35:00Z' and endTime eq '2017-06-02T18:55:00Z'
Sample response
{
"value": [
{
"name": {
"value": "cpu_percent",
"localizedValue": "CPU percentage"
},
"unit": "percent",
"timeGrain": "00:10:00",
"startTime": "2017-06-02T18:35:00Z",
"endTime": "2017-06-02T18:55:00Z",
"metricValues": [
{
"timestamp": "2017-06-02T18:30:01Z",
"average": 0,
"minimum": 0,
"maximum": 0,
"total": 0,
"count": 1
},
{
"timestamp": "2017-06-02T18:40:01Z",
"average": 0,
"minimum": 0,
"maximum": 0,
"total": 0,
"count": 1
},
{
"timestamp": "2017-06-02T18:50:01Z",
"average": 0,
"minimum": 0,
"maximum": 0,
"total": 0,
"count": 1
}
]
}
]
}
Definitions
| Name | Description |
|---|---|
| Metric |
Database metrics. |
|
Metric |
The response to a list database metrics request. |
|
Metric |
A database metric name. |
|
Metric |
Represents database metrics. |
|
Unit |
The unit of the metric. |
Metric
Database metrics.
| Name | Type | Description |
|---|---|---|
| endTime |
string (date-time) |
The end time for the metric (ISO-8601 format). |
| metricValues |
The metric values for the specified time window and timestep. |
|
| name |
The name information for the metric. |
|
| startTime |
string (date-time) |
The start time for the metric (ISO-8601 format). |
| timeGrain |
string |
The time step to be used to summarize the metric values. |
| unit |
The unit of the metric. |
MetricListResult
The response to a list database metrics request.
| Name | Type | Description |
|---|---|---|
| value |
Metric[] |
The list of metrics for the database. |
MetricName
A database metric name.
| Name | Type | Description |
|---|---|---|
| localizedValue |
string |
The friendly name of the database metric. |
| value |
string |
The name of the database metric. |
MetricValue
Represents database metrics.
| Name | Type | Description |
|---|---|---|
| average |
number (double) |
The average value of the metric. |
| count |
number (int32) |
The number of values for the metric. |
| maximum |
number (double) |
The max value of the metric. |
| minimum |
number (double) |
The min value of the metric. |
| timestamp |
string (date-time) |
The metric timestamp (ISO-8601 format). |
| total |
number (double) |
The total value of the metric. |
UnitType
The unit of the metric.
| Value | Description |
|---|---|
| count | |
| bytes | |
| seconds | |
| percent | |
| countPerSecond | |
| bytesPerSecond |