Eggplant Monitoring Insights API Query Examples

To illustrate how the API might be used, here is a selection of examples showing sample goals, their query strings, and their responses. Variable elements of the query string are highlighted in red. You can copy the query string, amending these variable elements to match your own circumstances, and then run the query on your own account.

Page Monitor Status and Test Results

Test Filters

  • Select the account ID
  • Select page monitor
  • Set StartDate to today
  • Set StartTime to 00:00:00
  • Set EndTime to Now using the pop-up time picker

Data Filters

Under Account > Pages > Page, select Url, Label, CurrentStatus, and ResultCode.

Under Account > Pages > Page > TestResults > TestResult, select LocalDateTime, Status, and ResultCode.

Query String (Generated by the Query Builder)

https://api.mon.eggplant.cloud/current/abcdefghijklmnopqrstuvwxyz123456/Return/[Account[Pages[Page[Url,Label,CurrentStatus,ResultCode,TestResults[TestResult[LocalDateTime,Status,ResultCode]]]]]]/AccountId/MN1A8878/Id/MN1PG43413/StartDate/2014-05-25/StartTime/00:00:00/EndTime/11:49:33/

Response in XML Format

<SiteConfidenceApi Version="current">

<Request Return="[Account[Pages[Page[Url,Label,CurrentStatus,ResultCode,TestResults[TestResult[LocalDateTime,Status,ResultCode]]]]]]" AccountId="MN1A8878" Id="MN1PG43413" StartDate="2014-05-25" StartTime="00:00:00" EndTime="11:49:33" />

<Response Status="Ok" Code="200" Message="Success.">

<Account>

<Pages>

<Page Url="http://www.bbc.co.uk/sport/0/football/" Label="BBC Football Home Page S1" CurrentStatus="OK" ResultCode="1">

<TestResults>

<TestResult LocalDateTime="2014-05-25 00:33:39" Status="OK" ResultCode="1"/>

<TestResult LocalDateTime="2014-05-25 01:33:39" Status="OK" ResultCode="1"/>

<TestResult LocalDateTime="2014-05-25 02:33:40" Status="OK" ResultCode="1"/>

<TestResult LocalDateTime="2014-05-25 03:33:39" Status="OK" ResultCode="1"/>

<TestResult LocalDateTime="2014-05-25 04:33:39" Status="OK" ResultCode="1"/>

<TestResult LocalDateTime="2014-05-25 05:33:40" Status="OK" ResultCode="1"/>

<TestResult LocalDateTime="2014-05-25 06:33:39" Status="OK" ResultCode="1"/>

<TestResult LocalDateTime="2014-05-25 07:33:39" Status="OK" ResultCode="1"/>

<TestResult LocalDateTime="2014-05-25 08:33:39" Status="OK" ResultCode="1"/>

<TestResult LocalDateTime="2014-05-25 09:33:40" Status="OK" ResultCode="1"/>

<TestResult LocalDateTime="2014-05-25 10:33:39" Status="OK" ResultCode="1"/>

<TestResult LocalDateTime="2014-05-25 11:33:39" Status="OK" ResultCode="1"/>

</TestResults>

</Page>

</Pages>

</Account>

</Response>

</SiteConfidenceApi>

The response shows that 12 tests have run so far today, and that all of those completed successfully without warnings (status OK, result code 1). Note that test results are displayed in chronological order, with the oldest results displayed first.

Average Speed of a User Journey

Test Filters

  • Select account ID
  • Select user journey (automatically selects all the steps in the user journey)

Data Filters

  • Under Account > UserJourneys > UserJourney, select Label.
  • Under Account > UserJourneys > UserJourney > TestingSummary > Last7Days, select AverageDownloadSpeed.
  • Under Account > UserJourneys > UserJourney > Steps > Step, select Label.
  • Under Account > UserJourneys > UserJourney > Steps > Step > TestingSummary > Last7Days, select AverageDownloadSpeed.

Query String (Generated by the Query Builder)

https://api.mon.eggplant.cloud/current/abcdefghijklmnopqrstuvwxyz123456/Return/[Account[UserJourneys[UserJourney[Label,TestingSummary[Last7Days[AverageDownloadSpeed]],Steps[Step[Label,TestingSummary[Last7Days[AverageDownloadSpeed]]]]]]]]/AccountId/MN1A8878/Id/MN1UJ4065,MN1UJ4065S50760,MN1UJ4065S50761,MN1UJ4065S50762,MN1UJ4065S50763,MN1UJ4065S50764,MN1UJ4065S51246,MN1UJ4065S51824/

Response in XML Format

<SiteConfidenceApi Version="current">

<Request Return="[Account[UserJourneys[UserJourney[Label,TestingSummary[Last7Days[AverageDownloadSpeed]],Steps[Step[Label,TestingSummary[Last7Days[AverageDownloadSpeed]]]]]]]]" AccountId="MN1A8878" Id="MN1UJ4065,MN1UJ4065S50760,MN1UJ4065S50761,MN1UJ4065S50762,MN1UJ4065S50763,MN1UJ4065S50764,MN1UJ4065S51246,MN1UJ4065S51824"/>

<Response Status="Ok" Code="200" Message="Success.">

<Account>

<UserJourneys>

<UserJourney Label="Test Journey">

<TestingSummary>

<Last7Days AverageDownloadSpeed="5.1024286"/>

</TestingSummary>

<Steps>

<Step Label="Step 1">

<TestingSummary>

<Last7Days AverageDownloadSpeed="2.8974286"/>

</TestingSummary>

</Step>

<Step Label="Step 2">

<TestingSummary>

<Last7Days AverageDownloadSpeed="0.7018571"/>

</TestingSummary>

</Step>

</Steps>

</UserJourney>

</UserJourneys>

</Account>

</Response>

</SiteConfidenceApi>

This response shows that the average download speed of the journey over the past seven days was 5.10 seconds and that the average download speed of the first two steps (others have been omitted for conciseness) is 2.89 seconds and 0.70 seconds, respectively.

Page Monitor Uptime for the Previous Calendar Month

Test Filters

  • Select account ID
  • Select page monitor
  • Set StartDate to the first day of the previous calendar month
  • Set StartTime to 00:00:00
  • Set EndDate to the last day of the previous calendar month
  • Set EndTime to 23:59:59

Data Filters

  • Under Account > Pages > Page, select Url and Label.
  • Under Account > Pages > Page > AvailabilitySummary > Availability, select Time.
  • Under Account > Pages > Page > AvailabilitySummary > Availability > Uptime, select Percentage and Time.
  • Under Account > Pages > Page > AvailabilitySummary > Availability > Warning, select Percentage and Time.
  • Under Account > Pages > Page > AvailabilitySummary > Availability > Problem, select Percentage and Time.
  • Under Account > Pages > Page > AvailabilitySummary > Availability > Down, select Percentage and Time.

Query String (Generated by the Query Builder)

https://api.mon.eggplant.cloud/current/abcdefghijklmnopqrstuvwxyz123456/Return/[Account[Pages[Page[Url,Label,AvailabilitySummary[Availability[Time,Uptime[Percentage,Time],Warning[Percentage,Time],Problem[Percentage,Time],Down[Percentage,Time]]]]]]]/AccountId/MN1A8878/Id/MN1PG50365/StartDate/2014-04-01/StartTime/00:00:00/EndDate/2014-04-30/EndTime/23:59:59/

Response in XML Format

<SiteConfidenceApi Version="current">

<Request Return="[Account[Pages[Page[Url,Label,AvailabilitySummary[Availability[Time,Uptime[Percentage,Time],Warning[Percentage,Time],Problem[Percentage,Time],Down[Percentage,Time]]]]]]]" AccountId="MN1A8878" Id="MN1PG50365" StartDate="2014-04-01" StartTime="00:00:00" EndDate="2014-04-30" EndTime="23:59:59"/>

<Response Status="Ok" Code="200" Message="Success.">

<Account>

<Pages>

<Page Url="http://www.o2.co.uk/login" Label="http://www.o2.co.uk/login">

<AvailabilitySummary>

<Availability Time="2592000">

<Uptime Percentage="99.106211419753" Time="2568833"/>

<Warning Percentage="0.13846450617284" Time="3589"/>

<Problem Percentage="0" Time="0"/>

<Down Percentage="0.75532407407407" Time="19578"/>

</Availability>

</AvailabilitySummary>

</Page>

</Pages>

</Account>

</Response>

</SiteConfidenceApi>

This response shows that during the previous calendar month, the uptime percentage for the monitor was 99.10%. This is the time that the monitor was up (2568833 seconds) expressed as a percentage of the total time period for the previous calendar month (2592000 seconds). Similarly, the monitor was in a confirmed Warning status for 0.14% of the month, a confirmed Problem status for 0% of the month and a confirmed Down status for 0.76% of the month.

Outcome, Time, and Speed for the Last Page Monitor Test

Test Filters

  • Select account ID
  • Select page monitor

Data Filters

  • Under Account > Pages > Page, select Url, Label, LastTestLocalDateTime, LastTestDownloadSpeed, CurrentStatus, and ResultCode.

Query String (Generated by the Query Builder)

https://api.mon.eggplant.cloud/current/abcdefghijklmnopqrstuvwxyz123456/Return/[Account[Pages[Page[Url,Label,LastTestLocalDateTime,LastTestDownloadSpeed,CurrentStatus,ResultCode]]]]/AccountId/MN1A8878/Id/MN1PG43413/

Response in XML Format

<SiteConfidenceApi Version="current">

<Request Return="[Account[Pages[Page[Url,Label,LastTestLocalDateTime,LastTestDownloadSpeed,CurrentStatus,ResultCode]]]]" AccountId="MN1A8878" Id="MN1PG43413”/>

<Response Status="Ok" Code="200" Message="Success.">

<Account>

<Pages>

<Page Url="http://www.bbc.co.uk/sport/0/football/" Label="BBC Football Home Page S1 " LastTestLocalDateTime="2014-05-25 11:33:39" LastTestDownloadSpeed="4.809" CurrentStatus="OK" ResultCode="1"/>

</Page>

</Pages>

</Account>

</Response>

</SiteConfidenceApi>

This response shows that the last test was run on 25/05/2014 at 11:33:39, and that it completed successfully without warnings (status OK, result code 1) with a download time of 4.809 seconds.

DNS Resolution Time, Connect Time, Data Start Time, and Overall Download Time for Page Monitor Tests

Test Filters

  • Select account ID
  • Select page monitor
  • Set StartDate to today
  • Set StartTime to 00:00:00
  • Set EndTime to Now using the time picker

Data Filters

  • Under Account > Pages > Page, select Url and Label.
  • Under Account > Pages > Page > TestResults > TestResult, select LocalDateTime, DnsSeconds, ConnectSeconds, DataStartSeconds, and TotalSeconds.

Query String (generated by the Query Builder)

https://api.mon.eggplant.cloud/current/abcdefghijklmnopqrstuvwxyz123456/Return/[Account[Pages[Page[Url,Label,TestResults[TestResult[LocalDateTime,DnsSeconds,ConnectSeconds,DataStartSeconds,TotalSeconds]]]]]]/AccountId/MN1A8878/Id/MN1PG43413/StartDate/2014-05-25/StartTime/00:00:00/EndTime/11:50:23

Response in XML Format

<SiteConfidenceApi Version="current">

<Request Return="[Account[Pages[Page[Url,Label,TestResults[TestResult[LocalDateTime,DnsSeconds,ConnectSeconds,DataStartSeconds,TotalSeconds]]]]]]" AccountId="MN1A8878" Id="MN1PG43413" StartDate="2014-05-25" StartTime="00:00:00" EndTime="11:50:23"/>

<Response Status="Ok" Code="200" Message="Success.">

<Account>

<Pages>

<Page Url="http://www.bbc.co.uk/sport/0/football/" Label="BBC Football Home Page S1">

<TestResults>

<TestResult LocalDateTime="2014-05-25 00:33:40" DnsSeconds="0.001" ConnectSeconds="0.002" DataStartSeconds="0.004" TotalSeconds="4.775"/>

<TestResult LocalDateTime="2014-05-25 01:33:39" DnsSeconds="0.001" ConnectSeconds="0" DataStartSeconds="0.074" TotalSeconds="4.916"/>

<TestResult LocalDateTime="2014-05-25 02:33:39" DnsSeconds="0.004" ConnectSeconds="0.002" DataStartSeconds="0.002" TotalSeconds="4.832"/>

<TestResult LocalDateTime="2014-05-25 03:33:39" DnsSeconds="0.001" ConnectSeconds="0.001" DataStartSeconds="0.006" TotalSeconds="6.635"/>

<TestResult LocalDateTime="2014-05-25 04:33:39" DnsSeconds="0.008" ConnectSeconds="0.002" DataStartSeconds="0.005" TotalSeconds="4.76"/>

<TestResult LocalDateTime="2014-05-25 05:33:39" DnsSeconds="0.006" ConnectSeconds="0.002" DataStartSeconds="0.08" TotalSeconds="4.776"/>

<TestResult LocalDateTime="2014-05-25 06:33:39" DnsSeconds="0.001" ConnectSeconds="0.001" DataStartSeconds="0.004" TotalSeconds="4.798"/>

<TestResult LocalDateTime="2014-05-25 07:33:40" DnsSeconds="0.002" ConnectSeconds="0.002" DataStartSeconds="0.086" TotalSeconds="4.723"/>

<TestResult LocalDateTime="2014-05-25 08:33:39" DnsSeconds="0.001" ConnectSeconds="0.001" DataStartSeconds="0.002" TotalSeconds="5.178"/>

<TestResult LocalDateTime="2014-05-25 09:33:40" DnsSeconds="0" ConnectSeconds="0.001" DataStartSeconds="0.002" TotalSeconds="4.753"/>

<TestResult LocalDateTime="2014-05-25 10:33:40" DnsSeconds="0" ConnectSeconds="0.002" DataStartSeconds="0.004" TotalSeconds="4.682"/>

<TestResult LocalDateTime="2014-05-25 11:33:39" DnsSeconds="0.002" ConnectSeconds="0.001" DataStartSeconds="0.003" TotalSeconds="4.809"/> </TestResults>

</Page>

</Pages>

</Account>

</Response>

</SiteConfidenceApi>

This response shows that the first test run today reported the following timings breakdown:

  • DNS Resolution Time: 0.001 seconds
  • Connection Time: 0.002 seconds
  • Data Start Time: 0.004 seconds
  • Overall Download Time: 4.775 seconds

Download Times for Components Downloaded by Page Monitor Tests

Test Filters

  • Select account ID
  • Select page monitor
  • Set StartDate, StartTime, EndDate, and EndTime so that the time range spans the relevant tests

Data Filters

  • Under Account > Pages > Page, select Url and Label.
  • Under Account > Pages > Page > TestResults > TestResult, select LocalDateTime.
  • Under Account > Pages > Page > TestResults > TestResult > TestResultDetails > ResultDetail, select ObjectUrl and TotalSeconds.

Query String (Generated by the Query Builder)

https://api.mon.eggplant.cloud/current/abcdefghijklmnopqrstuvwxyz123456/Return/[Account[Pages[Page[Url,Label,TestResults[TestResult[LocalDateTime,TestResultDetails[ResultDetail[ObjectUrl,TotalSeconds]]]]]]]]/AccountId/MN1A8878/Id/MN1PG43413/StartDate/2014-05-25/StartTime/10:52:00/EndTime/11:52:23/

Response (in XML format)

<SiteConfidenceApi Version="current">

<Request Return="[Account[Pages[Page[Url,Label,TestResults[TestResult[LocalDateTime,TestResultDetails[ResultDetail[ObjectUrl,TotalSeconds]]]]]]]]" AccountId="MN1A8878" Id="MN1PG43413" StartDate="2014-05-25" StartTime="10:52:00" EndTime="11:52:23"/>

<Response Status="Ok" Code="200" Message="Success.">

<Account>

<Pages>

<Page Url="http://www.bbc.co.uk/sport/0/football/" Label="BBC Football Home Page S1">

<TestResults>

<TestResult LocalDateTime="2014-05-25 11:33:39">

<TestResultDetails>

<ResultDetail ObjectUrl="http://www.bbc.co.uk/sport/0/football/" TotalSeconds="0.417"/>

<ResultDetail ObjectUrl="http://static.bbci.co.uk/frameworks/pulsesurvey/0.10.2/style/pulse.css" TotalSeconds="0.108"/>

<ResultDetail ObjectUrl="http://feeds.bbci.co.uk/modules/comments/getcount/?items=__CPS_27559180" TotalSeconds="0.109"/>

<ResultDetail ObjectUrl="http://news.bbcimg.co.uk/js/config/apps/4_7_2/bbc_fmtj_config.js" TotalSeconds="0.11"/>

<ResultDetail ObjectUrl="http://static.bbci.co.uk/sport/ui/3.2.172/css/desktop/elements/branding/olympics-2012.css" TotalSeconds="0.111"/>

<ResultDetail ObjectUrl="http://news.bbcimg.co.uk/media/images/75052000/jpg/_75052634_v1play.jpg" TotalSeconds="0.203"/>

</TestResultDetails>

</TestResult>

</TestResults>

</Page>

</Pages>

</Account>

</Response>

</SiteConfidenceApi>

This example response covers a single test, and for that test shows that the first object downloaded (the root component for the page test) was http://www.bbc.co.uk/sport/0/football/, which took 0.417 seconds to download. The last component was an image file located at http://news.bbcimg.co.uk/media/images/75052000/jpg/_75052634_v1play.jpg, which took 0.203 seconds to download.

Note: This type of query generates a lot of data for each test, so try to be as specific as possible when defining the tests to be covered by setting your test filters as narrowly as possible.

Monitoring and Alerting Status of All Page Monitors and User Journeys

Test Filters

  • Select account ID
  • Select each monitor (for user journeys, all steps automatically selected)

Data Filters

  • Under Account > Pages > Page, select Url, Label, Monitoring, and Alerting.
  • Under Account > UserJourneys > UserJourney, select Label and Monitoring.
  • Under Account > UserJourneys > UserJourney > Steps > Step, select Label, Monitoring, and Alerting.

Query String (Generated by the Query Builder)

https://api.mon.eggplant.cloud/current/abcdefghijklmnopqrstuvwxyz123456/Return/[Account[Pages[Page[Url,Label,Monitoring,Alerting]],UserJourneys[UserJourney[Label,Monitoring,Steps[Step[Label,Monitoring,Alerting]]]]]]/AccountId/MN1A8878/Id/MN1PG43413,MN1UJ4065,MN1UJ4065S50760,MN1UJ4065S50761,MN1UJ4065S50762,MN1UJ4065S50763,MN1UJ4065S50764,MN1UJ4065S51246,MN1UJ4065S51824/

Response in XML Format

<SiteConfidenceApi Version="current">

<Request Return="[Account[Pages[Page[Url,Label,Monitoring,Alerting]],UserJourneys[UserJourney[Label,Monitoring,Steps[Step[Label,Monitoring,Alerting]]]]]]" AccountId="MN1A8878" Id="MN1PG43413,MN1UJ4065,MN1UJ4065S50760,MN1UJ4065S50761,MN1UJ4065S50762,MN1UJ4065S50763,MN1UJ4065S50764,MN1UJ4065S51246,MN1UJ4065S51824"/>

<Response Status="Ok" Code="200" Message="Success.">

<Account>

<Pages>

<Page Url="http://www.bbc.co.uk/sport/0/football/" Label="BBC Football Home Page S1" Monitoring="true" Alerting="true"/>

</Pages>

<UserJourneys>

<UserJourney Label="Test Journey" Monitoring="true">

<Steps>

<Step Label="Step 1" Monitoring="true" Alerting="false"/>

<Step Label="Step 2" Monitoring="true" Alerting="false"/>

<Step Label="Step 3" Monitoring="true" Alerting="false"/>

<Step Label="Step 4" Monitoring="true" Alerting="false"/>

<Step Label="Step 5" Monitoring="true" Alerting="false"/>

<Step Label="Step 6" Monitoring="false" Alerting="false"/>

<Step Label="Step 7" Monitoring="false" Alerting="false"/>

</Steps>

</UserJourney>

</UserJourneys>

</Account>

</Response>

</SiteConfidenceApi>

This response shows that for this account, there is one page monitor and one user journey. The page monitor has monitoring enabled and alerting enabled. For the user journey, monitoring is enabled although steps 6 and 7 are disabled, and alerting is disabled on all steps.

 

This topic was last updated on January 30, 2020, at 10:57:16 PM.

Eggplant icon Eggplantsoftware.com | Documentation Home | User Forums | Support | Copyright © 2020 Eggplant