How to query for the number of objects per test

Discussion of the NCC Group Web Performance Monitoring API.
Before posting, please read the guidelines

How to query for the number of objects per test

Postby PaulB » Mon Feb 24, 2014 11:27 am

A customer wanted to track how the content of their site changed over a period of time, specifically related to the number of objects they were downloading.

This can be done via the API which also allows you to extract the information for specific date/time ranges. For example, you may have a dynamic site that downloads more objects during a specific time period each day (such as for flash offers), or on different days of the week.

If you just want the number of objects, then you do this by querying for the "Count" against the "TestResultDetails", like this:

Code: Select all
Return/[Account[Pages[Page[TestResults[TestResult[TestResultDetails[Count]]]]]]]



Depending on what you are doing, you may well also want to include the date/time or ID of the test, in which case just add those in the return statement too, like this:

Code: Select all
Return/[Account[Pages[Page[TestResults[TestResult[Id,GmtDateTime,TestResultDetails[Count]]]]]]]



If you do want to limit the date/time period as in the original description of the requirement, then append this to the overall query, like this:

Code: Select all
/StartDate/2014-02-23/StartTime/06:00:00/EndDate/2014-02-23/EndTime/09:00:00



Putting this all together, you'd get a query something like this:

Code: Select all
https://api.siteconfidence.co.uk/current/api_key/Return/[Account[Pages[Page[TestResults[TestResult[Id,GmtDateTime,TestResultDetails[Count]]]]]]]/AccountId/IdOfAccount/Id/IdOfMonitor/StartDate/2014-02-23/StartTime/06:00:00/EndDate/2014-02-23/EndTime/09:00:00
PaulB
NCC Group Employee
NCC Group Employee
 
Posts: 4
Joined: Thu Nov 29, 2012 1:14 pm

Return to API

Who is online

Users browsing this forum: No registered users and 1 guest