Databases - List 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 參數

名稱 位於 必要 類型 Description
databaseName
path True

string

資料庫的名稱。

resourceGroupName
path True

string

包含資源的資源群組名稱。 您可以從 Azure Resource Manager API 或入口網站取得此值。

serverName
path True

string

伺服器的名稱。

subscriptionId
path True

string

識別 Azure 訂用帳戶的訂用帳戶標識碼。

$filter
query True

string

描述要傳回之計量子集的 OData 篩選表示式。

api-version
query True

string

要用於要求的 API 版本。

回應

名稱 類型 Description
200 OK

MetricListResult

還行

範例

List database usage metrics

範例要求

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'

範例回覆

{
  "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
        }
      ]
    }
  ]
}

定義

名稱 Description
Metric

資料庫計量。

MetricListResult

清單資料庫計量要求的回應。

MetricName

資料庫計量名稱。

MetricValue

表示資料庫計量。

UnitType

計量的單位。

Metric

資料庫計量。

名稱 類型 Description
endTime

string (date-time)

計量的結束時間(ISO-8601 格式)。

metricValues

MetricValue[]

指定時間範圍和時間步驟的計量值。

name

MetricName

計量的名稱資訊。

startTime

string (date-time)

計量的開始時間(ISO-8601 格式)。

timeGrain

string

用來摘要計量值的時間步驟。

unit

UnitType

計量的單位。

MetricListResult

清單資料庫計量要求的回應。

名稱 類型 Description
value

Metric[]

資料庫的計量清單。

MetricName

資料庫計量名稱。

名稱 類型 Description
localizedValue

string

資料庫計量的易記名稱。

value

string

資料庫計量的名稱。

MetricValue

表示資料庫計量。

名稱 類型 Description
average

number (double)

計量的平均值。

count

number (int32)

計量的值數目。

maximum

number (double)

計量的最大值。

minimum

number (double)

計量的最小值。

timestamp

string (date-time)

計量時間戳 (ISO-8601 格式)。

total

number (double)

計量的總值。

UnitType

計量的單位。

值 Description
count
bytes
seconds
percent
countPerSecond
bytesPerSecond