你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
有关在 Azure 门户中使用这些查询的信息,请参阅 Log Analytics 教程。 有关 REST API,请参阅查询。
获取通话中所有参与者的媒体时序统计信息
基于 ACSCallClientMediaStatsTimeSeries 日志提取给定呼叫中所有参与者的时序媒体统计信息
// Replace queryConditions_callId with the callId you want to investigate.
// Note this query is used in Call Diagnostics timeline page to get all the time series media metrics for all participants in the call.
declare query_parameters(queryConditions_callId:string = 'replace-with-your-callId');
ACSCallClientMediaStatsTimeSeries
| where CallId == queryConditions_callId
| extend lcMediaStreamType = tolower(MediaStreamType)
| extend lcMediaStreamDirection = tolower(MediaStreamDirection)
| extend isIncoming = case(
lcMediaStreamDirection == 'recv', true,
lcMediaStreamDirection == 'incoming', true,
false)
| extend isOutgoing =
case(lcMediaStreamDirection == 'send', true,
lcMediaStreamDirection == 'outgoing', true,
false)
| extend MediaStreamDirectionType = case(isIncoming == true, 'recv', "send")
| summarize hint.strategy = shuffle arg_max(OperationName, *) by CallClientTimeStamp, MetricName, MediaStreamDirection, MediaStreamType, MediaStreamDirectionType
| order by CallClientTimeStamp asc
| summarize hint.strategy = shuffle arg_max(OperationName, *), newAverage = avg(Average) by CallClientTimeStamp, MetricName, MediaStreamDirection, MediaStreamType, MediaStreamDirectionType
| summarize hint.strategy = shuffle
Timestamps = make_list(CallClientTimeStamp),
Values = make_list(newAverage),
MediaStreamCodec = make_list(MediaStreamCodec) by MetricName, ParticipantId, MediaStreamDirection, MediaStreamType, MediaStreamDirectionType
| extend (Timestamps, Values, MediaStreamCodec) = array_sort_asc(Timestamps, Values, MediaStreamCodec)
| project Timestamps, Values, MediaStreamCodec, MetricName, ParticipantId, MediaStreamDirection, MediaStreamType, MediaStreamDirectionType
每个媒体类型的指标
列出每个媒体流类型的 ACSCallClientMediaStatsTimeSeries 日志中包含的所有媒体指标。
ACSCallClientMediaStatsTimeSeries
| distinct MetricName, MediaStreamType
按媒体类型和方向显示的指标直方图
按 callId、participantId、媒体类型和媒体方向绘制所选指标的直方图
let PlotMetricHistogram = (_MetricName: string, _ParticipantId: string = '', _CallId: string = '', _MediaStreamType: string = '', _MediaStreamDirection: string = '') {
// _MetricName: the name of the metric. This must be set.
// _ParticipantId: set this variable if want to just plot the metric value histogram for a specific partiticpant.
// _CallId: set this variable if want to just plot the metric value histogram for a specific call.
// _MediaStreamType: possible values can be: 'audio', 'video', 'screen'.
// _MediaStreamDirection: possible values can be: 'recv', 'send'.
ACSCallClientMediaStatsTimeSeries
| where MetricName == _MetricName
| where isempty(_ParticipantId) or ParticipantId == _ParticipantId
| where isempty(_CallId) or CallId == _CallId
| where isempty(_MediaStreamType) or MediaStreamType == _MediaStreamType
| where isempty(_MediaStreamDirection) or MediaStreamDirection == _MediaStreamDirection
| summarize count=count() by Average
| render columnchart title=strcat(_MetricName, " Histogram")
};
// Below plots the histogram for jitter for all outbound audio streams
PlotMetricHistogram('JitterInMs', _MediaStreamType='audio', _MediaStreamDirection='send')