Managed Instances - List By Managed Instance

マネージド インスタンスの上位のリソース消費クエリを取得します。

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries?api-version=2021-11-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries?numberOfQueries={numberOfQueries}&databases={databases}&startTime={startTime}&endTime={endTime}&interval={interval}&aggregationFunction={aggregationFunction}&observationMetric={observationMetric}&api-version=2021-11-01

URI パラメーター

名前 / 必須 説明
managedInstanceName
path True

string

マネージド インスタンスの名前。

resourceGroupName
path True

string

リソースが含まれているリソース グループの名前。 この値は、Azure リソース マネージャー API またはポータルから取得できます。

subscriptionId
path True

string

Azure サブスクリプションを識別するサブスクリプション ID。

api-version
query True

string

要求で使用する API のバージョン。

aggregationFunction
query

AggregationFunctionType

使用する集計関数。既定値は 'sum' です

databases
query

string

検索に含めるデータベースのコンマ区切りリスト。 このパラメーターが指定されていない場合は、すべての DB が含まれます。

endTime
query

string

観測された期間の終了時刻。

interval
query

QueryTimeGrainType

メトリック値の集計に使用する時間ステップ。 既定値は PT1H です

numberOfQueries
query

integer

int32

返す '上位クエリ' の数。 既定値は 5 です。

observationMetric
query

MetricType

上位のクエリのランク付けに使用されるメトリック。 既定値は 'cpu' です

startTime
query

string

観測された期間の開始時刻。

応答

名前 説明
200 OK

TopQueriesListResult

マネージド インスタンスの上位クエリが正常に取得されました。

Other Status Codes

エラー応答: ***

  • 404 SubscriptionDoesNotHaveServer - 要求されたサーバーが見つかりませんでした

  • 404 ServerNotInSubscriptionResourceGroup - 指定されたサーバーが、指定されたリソース グループとサブスクリプションに存在しません。

  • 404 ResourceNotFound - 要求されたリソースが見つかりませんでした。

Obtain list of instance's top resource consuming queries.
Obtain list of instance's top resource consuming queries. Full-blown request and response.
Obtain list of instance's top resource consuming queries. Minimal request and response.

Obtain list of instance's top resource consuming queries.

Sample Request

GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/topqueries?interval=PT1H&observationMetric=duration&api-version=2021-11-01

Sample Response

{
  "value": [
    {
      "numberOfQueries": 5,
      "aggregationFunction": "sum",
      "observationMetric": "cpu",
      "intervalType": "P1D",
      "startTime": "03/01/2020 00:00:00",
      "endTime": "03/05/2020 13:00:00",
      "queries": [
        {
          "databaseName": "db1",
          "queryId": "25",
          "intervals": [
            {
              "intervalStartTime": "03/03/2020 00:00:00",
              "executionCount": 1,
              "metrics": [
                {
                  "name": "cpu",
                  "displayName": "Cpu",
                  "unit": "percentage",
                  "value": 0.0015841714409722222
                },
                {
                  "name": "io",
                  "displayName": "Physical Io Reads",
                  "unit": "percentage",
                  "value": 4.340277777777778E-06
                },
                {
                  "name": "logIo",
                  "displayName": "Log Writes",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "memory",
                  "displayName": "Memory consumption",
                  "unit": "KB",
                  "value": 8336
                },
                {
                  "name": "duration",
                  "displayName": "Query duration",
                  "unit": "microseconds",
                  "value": 11306905
                }
              ]
            }
          ]
        },
        {
          "databaseName": "db1",
          "queryId": "21",
          "intervals": [
            {
              "intervalStartTime": "03/03/2020 00:00:00",
              "executionCount": 1,
              "metrics": [
                {
                  "name": "cpu",
                  "displayName": "Cpu",
                  "unit": "percentage",
                  "value": 0.0009521432291666667
                },
                {
                  "name": "io",
                  "displayName": "Physical Io Reads",
                  "unit": "percentage",
                  "value": 2.3148148148148148E-07
                },
                {
                  "name": "logIo",
                  "displayName": "Log Writes",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "memory",
                  "displayName": "Memory consumption",
                  "unit": "KB",
                  "value": 1024
                },
                {
                  "name": "duration",
                  "displayName": "Query duration",
                  "unit": "microseconds",
                  "value": 6620020
                }
              ]
            }
          ]
        },
        {
          "databaseName": "db3",
          "queryId": "3",
          "intervals": [
            {
              "intervalStartTime": "03/04/2020 00:00:00",
              "executionCount": 104,
              "metrics": [
                {
                  "name": "cpu",
                  "displayName": "Cpu",
                  "unit": "percentage",
                  "value": 0.0008006611689814815
                },
                {
                  "name": "io",
                  "displayName": "Physical Io Reads",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "logIo",
                  "displayName": "Log Writes",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "memory",
                  "displayName": "Memory consumption",
                  "unit": "KB",
                  "value": 0
                },
                {
                  "name": "duration",
                  "displayName": "Query duration",
                  "unit": "microseconds",
                  "value": 5543088
                }
              ]
            }
          ]
        },
        {
          "databaseName": "db2",
          "queryId": "3",
          "intervals": [
            {
              "intervalStartTime": "03/03/2020 00:00:00",
              "executionCount": 89,
              "metrics": [
                {
                  "name": "cpu",
                  "displayName": "Cpu",
                  "unit": "percentage",
                  "value": 0.0006882543402777778
                },
                {
                  "name": "io",
                  "displayName": "Physical Io Reads",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "logIo",
                  "displayName": "Log Writes",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "memory",
                  "displayName": "Memory consumption",
                  "unit": "KB",
                  "value": 0
                },
                {
                  "name": "duration",
                  "displayName": "Query duration",
                  "unit": "microseconds",
                  "value": 4761877
                }
              ]
            }
          ]
        },
        {
          "databaseName": "db3",
          "queryId": "22",
          "intervals": [
            {
              "intervalStartTime": "03/04/2020 00:00:00",
              "executionCount": 1,
              "metrics": [
                {
                  "name": "cpu",
                  "displayName": "Cpu",
                  "unit": "percentage",
                  "value": 0.0006220661168981482
                },
                {
                  "name": "io",
                  "displayName": "Physical Io Reads",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "logIo",
                  "displayName": "Log Writes",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "memory",
                  "displayName": "Memory consumption",
                  "unit": "KB",
                  "value": 1024
                },
                {
                  "name": "duration",
                  "displayName": "Query duration",
                  "unit": "microseconds",
                  "value": 4454161
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Obtain list of instance's top resource consuming queries. Full-blown request and response.

Sample Request

GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/topqueries?databases=db1,db2&startTime=2020-03-10T12:00:00Z&endTime=2020-03-12T12:00:00Z&interval=P1D&observationMetric=cpu&api-version=2021-11-01

Sample Response

{
  "value": [
    {
      "numberOfQueries": 5,
      "aggregationFunction": "sum",
      "observationMetric": "cpu",
      "intervalType": "P1D",
      "startTime": "03/10/2020 00:00:00",
      "endTime": "03/12/2020 13:00:00",
      "queries": [
        {
          "databaseName": "db1",
          "queryId": "28",
          "intervals": [
            {
              "intervalStartTime": "03/11/2020 00:00:00",
              "executionCount": 1,
              "metrics": [
                {
                  "name": "cpu",
                  "displayName": "Cpu",
                  "unit": "percentage",
                  "value": 0.0015934667245370371
                },
                {
                  "name": "io",
                  "displayName": "Physical Io Reads",
                  "unit": "percentage",
                  "value": 4.224537037037037E-06
                },
                {
                  "name": "logIo",
                  "displayName": "Log Writes",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "memory",
                  "displayName": "Memory consumption",
                  "unit": "KB",
                  "value": 8336
                },
                {
                  "name": "duration",
                  "displayName": "Query duration",
                  "unit": "microseconds",
                  "value": 11091296
                }
              ]
            }
          ]
        },
        {
          "databaseName": "db1",
          "queryId": "24",
          "intervals": [
            {
              "intervalStartTime": "03/11/2020 00:00:00",
              "executionCount": 1,
              "metrics": [
                {
                  "name": "cpu",
                  "displayName": "Cpu",
                  "unit": "percentage",
                  "value": 0.0009522783564814815
                },
                {
                  "name": "io",
                  "displayName": "Physical Io Reads",
                  "unit": "percentage",
                  "value": 1.7361111111111112E-07
                },
                {
                  "name": "logIo",
                  "displayName": "Log Writes",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "memory",
                  "displayName": "Memory consumption",
                  "unit": "KB",
                  "value": 1024
                },
                {
                  "name": "duration",
                  "displayName": "Query duration",
                  "unit": "microseconds",
                  "value": 6625562
                }
              ]
            }
          ]
        },
        {
          "databaseName": "db1",
          "queryId": "3",
          "intervals": [
            {
              "intervalStartTime": "03/11/2020 00:00:00",
              "executionCount": 82,
              "metrics": [
                {
                  "name": "cpu",
                  "displayName": "Cpu",
                  "unit": "percentage",
                  "value": 0.0007183139467592593
                },
                {
                  "name": "io",
                  "displayName": "Physical Io Reads",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "logIo",
                  "displayName": "Log Writes",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "memory",
                  "displayName": "Memory consumption",
                  "unit": "KB",
                  "value": 0
                },
                {
                  "name": "duration",
                  "displayName": "Query duration",
                  "unit": "microseconds",
                  "value": 4970199
                }
              ]
            }
          ]
        },
        {
          "databaseName": "db1",
          "queryId": "29",
          "intervals": [
            {
              "intervalStartTime": "03/11/2020 00:00:00",
              "executionCount": 1,
              "metrics": [
                {
                  "name": "cpu",
                  "displayName": "Cpu",
                  "unit": "percentage",
                  "value": 0.0006494454571759259
                },
                {
                  "name": "io",
                  "displayName": "Physical Io Reads",
                  "unit": "percentage",
                  "value": 5.034722222222222E-06
                },
                {
                  "name": "logIo",
                  "displayName": "Log Writes",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "memory",
                  "displayName": "Memory consumption",
                  "unit": "KB",
                  "value": 1024
                },
                {
                  "name": "duration",
                  "displayName": "Query duration",
                  "unit": "microseconds",
                  "value": 4530668
                }
              ]
            }
          ]
        },
        {
          "databaseName": "db2",
          "queryId": "25",
          "intervals": [
            {
              "intervalStartTime": "03/11/2020 00:00:00",
              "executionCount": 1,
              "metrics": [
                {
                  "name": "cpu",
                  "displayName": "Cpu",
                  "unit": "percentage",
                  "value": 0.0006275368923611112
                },
                {
                  "name": "io",
                  "displayName": "Physical Io Reads",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "logIo",
                  "displayName": "Log Writes",
                  "unit": "percentage",
                  "value": 0
                },
                {
                  "name": "memory",
                  "displayName": "Memory consumption",
                  "unit": "KB",
                  "value": 1024
                },
                {
                  "name": "duration",
                  "displayName": "Query duration",
                  "unit": "microseconds",
                  "value": 4349943
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Obtain list of instance's top resource consuming queries. Minimal request and response.

Sample Request

GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/sqlcrudtest-7398/providers/Microsoft.Sql/managedInstances/sqlcrudtest-4645/topqueries?api-version=2021-11-01

Sample Response

{
  "value": [
    {
      "numberOfQueries": 5,
      "aggregationFunction": "sum",
      "observationMetric": "cpu",
      "intervalType": "PT1H",
      "startTime": "03/10/2020 12:00:00",
      "endTime": "03/11/2020 12:24:07",
      "queries": []
    }
  ]
}

定義

名前 説明
AggregationFunctionType

使用する集計関数。既定値は 'sum' です

MetricType

上位のクエリのランク付けに使用されるメトリック。 既定値は 'cpu' です

QueryMetricInterval

クエリ メトリック間隔のプロパティ。

QueryMetricProperties

1 つの間隔での topquery メトリックのプロパティ。

QueryMetricUnitType

メトリックの単位。

QueryStatisticsProperties

クエリ実行統計のプロパティ。

QueryTimeGrainType

間隔の種類 (長さ)。

TopQueries
TopQueriesListResult

マネージド インスタンスでクエリを消費する上位のリソースの一覧

AggregationFunctionType

使用する集計関数。既定値は 'sum' です

名前 説明
avg

string

max

string

min

string

stdev

string

sum

string

MetricType

上位のクエリのランク付けに使用されるメトリック。 既定値は 'cpu' です

名前 説明
cpu

string

dtu

string

duration

string

io

string

logIo

string

QueryMetricInterval

クエリ メトリック間隔のプロパティ。

名前 説明
executionCount

integer

この間隔でのクエリの実行数。

intervalStartTime

string

メトリック間隔の開始時刻 (ISO-8601 形式)。

intervalType

QueryTimeGrainType

間隔の種類 (長さ)。

metrics

QueryMetricProperties[]

この間隔のメトリック オブジェクトの一覧

QueryMetricProperties

1 つの間隔での topquery メトリックのプロパティ。

名前 説明
avg

number

avg() 集計関数が間隔にわたって使用される場合のメトリック値。

displayName

string

メトリックの UI の適切な名前。

max

number

間隔で max() 集計関数が使用される場合のメトリック値。

min

number

間隔で min() 集計関数が使用される場合のメトリック値。

name

string

メトリックの名前情報。

stdev

number

stdev 集計関数が間隔にわたって使用される場合のメトリック値。

sum

number

間隔で sum() 集計関数が使用される場合のメトリック値。

unit

QueryMetricUnitType

メトリックの単位。

value

number

メトリックの値。

QueryMetricUnitType

メトリックの単位。

名前 説明
KB

string

count

string

microseconds

string

percentage

string

QueryStatisticsProperties

クエリ実行統計のプロパティ。

名前 説明
databaseName

string

このクエリが実行されたデータベースのデータベース名。

endTime

string

メトリックの終了時刻 (ISO-8601 形式)。

intervals

QueryMetricInterval[]

適切なメトリック データを含む間隔の一覧

queryId

string

一意のクエリ ID (1 つのデータベース内で一意)。

startTime

string

メトリックの開始時刻 (ISO-8601 形式)。

QueryTimeGrainType

間隔の種類 (長さ)。

名前 説明
P1D

string

PT1H

string

TopQueries

名前 説明
aggregationFunction

string

クエリ メトリックの計算に使用される集計関数。

endTime

string

メトリックの終了時刻 (ISO-8601 形式)。

intervalType

QueryTimeGrainType

間隔の種類 (長さ)。

numberOfQueries

integer

上位のクエリの要求数。

observationMetric

string

クエリのランク付けに使用されるメトリック。

queries

QueryStatisticsProperties[]

適切なメトリック データを含む上位のリソース消費クエリの一覧

startTime

string

メトリックの開始時刻 (ISO-8601 形式)。

TopQueriesListResult

マネージド インスタンスでクエリを消費する上位のリソースの一覧

名前 説明
nextLink

string

結果の次のページを取得するためのリンク。

value

TopQueries[]

結果の配列。