次の方法で共有


Sample Call Quality Methodology Scorecard based on data from Call Quality Dashboard

Call Quality Dashboard (CQD) provides a Web API for access to the report Structure and Analysis Cube Data. The Portal element of CQD is built using this API. At the Ignite 2015 conference in our Skype for Business: Server Vital Signs session I showed how I had implemented a sample Call Quality Methodology (CQM) Scorecard using this Web API. This post provides the sample and some explanation on how to install, configure and use it.Skype for Business: Server Vital SignsSkype for Business: Server Vital Signs

We are currently finishing the documentation of the Web API and it will be available soon. I'll update this post with the link, when it becomes available.

The sample is shown below.

Installation of the sample

The sample is provided in the attached ZIP file. Unzip the file and copy the CQMScorecardSample.html file to a web server in your deployment. I have it located on my CQD Portal server in the c:\inetpub\wwwroot directory.

People, who are already able to access the CQD Portal and see data, should also be able to use the sample.

Configuration of the sample

You need to edit the HTML file and replace the two references to CQDSRV1 with the hostname or FQDN of your own CQD Portal server.

Implementation Details

It is a sample, so I've have not done much to make the code pretty or smart. The HTML file both contains the mark-up to define the CQM Scorecard table and text and the JavaScript code to access the Web API. In production code you would probably separate these components into separate files.

Target

The target for the different elements are hard-coded in the definition of the corresponding query.

Query

The query is comprised of Dimensions, Filters, Measurements and Trend. The easiest way of writing the query you want is to use the CQD Portal Query Editor. After you have specified your query and seen that it return the results you expect, you can use Fiddler or F12 in IE to see the query the Portal sends via the Web API. Look for url's ending in QoEDataService/RunQuery and then for the Request Body. That contains the query and you can use that directly in your JavaScript.

In the sample I'm using the API to get data return per day for a number of months. The var numMonthsToShow specifies how many months are wanted.

In order to get the Web API to return data from a date range you need to do the following:

  • You need to have Month added as both a Dimension and a Filter - [StartDate].[Month]
  • Have a valid month defined in the filter. If you leave it out, you'll get all data returned
  • Have enabled Trend in the query. SpanCount will control how many months of data to return

In my sample I want to get the data returned by date instead of month and I've therefore added the Dimension [StartDate].[Date] to achieve that. An example query, where it asks for 6 months of data, looks like this:

{"Dimensions":[

{"DataModelName":"[StartDate].[Month]"},

{"DataModelName":"[StartDate].[Date]"}

],

"Filters":[

{"DataModelName":"[First User Agent].[User Agent Type]","Caption":"MediationServer","Value":"[MediationServer]","Operand":0,"UnionGroup":""},

{"DataModelName":"[Second User Agent].[User Agent Type]","Caption":"AV-MCU","Value":"[AV-MCU]","Operand":0,"UnionGroup":""},

{"DataModelName":"[StreamType].[StreamType]","Caption":"Valid","Value":"[False]","Operand":0,"UnionGroup":""},

{"DataModelName":"[StartDate].[Month]","Caption":"Valid","Value":"2015-4","Operand":0,"UnionGroup":""}

],

"Measurements":[

{"DataModelName":"[Measures].[AudioOnePercentPacketLossPercentage]"}

],

"Trend":{"EnableTrend":true,"SpanCount":6,"TrendDate":"2015-4","Type":0}}

   

Referencing query results

You need to be able to reference the actual result returned by the query. You do that by looping over the result set. The actual result can be obtained by referencing into the DataResult as an array with base 0. DataResult is constructed as a combination of the dimensions and the measurements you ask for in the query. In the sampel query above I have [StartDate].[Month], [StartDate].[Date], [Measures].[AudioOnePercentPacketLossPercentage]. That is reflected in the DataResult reponse which has month, date and AudioOnePercentPacketLossPercentage:

{"ExecutionTime":"00:00:00.0508488","DataResult":[["December 2014","Monday, December 15 2014",0.0]],"ResultIsFromCache":false,"ErrorType":0}

    I'm only interested in the AudioOnePercentPacketLossPercentage value, so I reference the 3rd element by using index 2 into the array:

for (var m = 0; m < data.DataResult.length; m++) {

sumValue = sumValue + parseFloat(data.DataResult[m][2]);

};

Support

This is a sample and comes with no support what so ever J

https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-60-41/CQMScorecardSample.zip