你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

MetricsExtensions.GetIntervaledSegmentedMetricAsync 方法

定义

检索指标数据

public static System.Threading.Tasks.Task<Microsoft.Azure.ApplicationInsights.Query.Models.MetricsIntervaledSegmentedResult> GetIntervaledSegmentedMetricAsync (this Microsoft.Azure.ApplicationInsights.Query.IMetrics operations, string appId, string metricId, string timespan = default, TimeSpan? interval = default, System.Collections.Generic.IList<string> aggregation = default, System.Collections.Generic.IList<string> segment = default, int? top = default, string orderby = default, string filter = default, System.Threading.CancellationToken cancellationToken = default);
static member GetIntervaledSegmentedMetricAsync : Microsoft.Azure.ApplicationInsights.Query.IMetrics * string * string * string * Nullable<TimeSpan> * System.Collections.Generic.IList<string> * System.Collections.Generic.IList<string> * Nullable<int> * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.ApplicationInsights.Query.Models.MetricsIntervaledSegmentedResult>
<Extension()>
Public Function GetIntervaledSegmentedMetricAsync (operations As IMetrics, appId As String, metricId As String, Optional timespan As String = Nothing, Optional interval As Nullable(Of TimeSpan) = Nothing, Optional aggregation As IList(Of String) = Nothing, Optional segment As IList(Of String) = Nothing, Optional top As Nullable(Of Integer) = Nothing, Optional orderby As String = Nothing, Optional filter As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of MetricsIntervaledSegmentedResult)

参数

operations
IMetrics

此扩展方法的操作组。

appId
String

应用程序的 ID。 这是Azure 门户“API 访问设置”边栏选项卡中的应用程序 ID。

metricId
String

指标的 ID。 这是标准 AI 指标或特定于应用程序的自定义指标。 可能的值包括:“requests/count”、“requests/duration”、“requests/failed”、“users/count”、“users/authenticated”、“pageViews/count”、 “pageViews/duration”、“client/processingDuration”、“client/receiveDuration”、“client/networkDuration”、“client/sendDuration”、“client/totalDuration”、“dependencies/count”、“dependencies/failed”、“dependencies/duration”、“exceptions/count”、“exceptions/browser”、“exceptions/server”、“sessions/count”、“sessions/count”、“performanceCounters/requestExecutionTime“、”performanceCounters/requestsPerSecond“、”performanceCounters/requestsInQueue“, ”performanceCounters/memoryAvailableBytes“、”performanceCounters/exceptionsPerSecond“、”performanceCounters/processCpuPercentage“、”performanceCounters/processIOBytesPerSecond“、”performanceCounters/processPrivateBytes“、”performanceCounters/processorCpuPercentage“、”availabilityResults/availabilityPercentage“、”availabilityResults/duration“、”billing/telemetryCount', 'customEvents/count'

timespan
String

检索指标值的时间跨度。 这是 ISO8601 时间段值。 如果省略时间跨度,则使用默认时间范围 PT12H (“过去 12 小时”) 。 查询的实际时间跨度可由基于服务器的调整。 在所有情况下,用于查询的实际时间跨度都包含在响应中。

interval
Nullable<TimeSpan>

检索指标值时要使用的时间间隔。 这是 ISO8601 持续时间。 如果省略间隔,则会在整个时间跨度内聚合指标值。 如果提供间隔,服务器可能会根据查询所用的时间跨度将间隔调整为更合适的大小。 在所有情况下,用于查询的实际间隔都包含在响应中。

aggregation
IList<String>

计算指标值时使用的聚合。 若要一次检索多个聚合,请使用逗号分隔它们。 如果未指定聚合,则使用指标的默认聚合。

segment
IList<String>

要按其划分指标值的维度的名称。 此维度必须适用于要检索的指标。 若要一次按多个维度分段,请使用逗号 (,) 分隔它们。 在这种情况下,指标数据将按维度在 参数中列出的顺序进行分段。

top
Nullable<Int32>

要返回的段数。 此值仅在指定段时有效。

orderby
String

对段进行排序的聚合函数和方向。 此值仅在指定段时有效。

filter
String

用于筛选结果的表达式。 此值应该是有效的 OData 筛选器表达式,其中每个子句的键应是所检索指标的适用维度。

cancellationToken
CancellationToken

取消标记。

返回

注解

获取单个指标的指标值

适用于