แก้ไข

แชร์ผ่าน


Queries for the ACSCallClientMediaStatsTimeSeries table

For information on using these queries in the Azure portal, see Log Analytics tutorial. For the REST API, see Query.

Fetch time series media stats of all participants in a call

Fetch time series media stats of all participants in a given call based on ACSCallClientMediaStatsTimeSeries log

// 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

Metrics per each media type

List all the media metrics included in the ACSCallClientMediaStatsTimeSeries log for each media stream type.

ACSCallClientMediaStatsTimeSeries
| distinct MetricName, MediaStreamType

Metric histogram per media type and direction

Plot the histogram of selected metric, per callId, participantId, media type and meida direction

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')