Get Real-Time Statistics by Country and Edge CNAME

Reports the following real-time statistics for traffic delivered over the specified platform:

Learn more.

As indicated above, real-time statistics may be reported on a per edge CNAME basis. This type of data is only reported for edge CNAME configurations where the Custom Reports option has been enabled.

The response may be filtered by one or more of the following criteria:

Learn how real-time statistics are calculated.

Request

A request to retrieve real-time statistics is described below.

HTTP Method Request URI

GET

https://api.edgecast.com/v2/reporting/customers/AccountNumber/countryrealtimestats/Platform?cname=EdgeCNAME&country=CountryCode

Define the following variables when submitting the above request:

VariableA variable represents a value that must be replaced. A variable consists of either a URL segment (e.g., "0001" in /0001/) or a query string value (e.g., "3" in mediaTypes=3). Description

AccountNumber

Required

Replace this variable with a customer account number. This account number may be found in the upper right-hand corner of the MCC.

Platform

Required

Replace this variable with the platform for which real-time statistics will be reported.

Valid values are:

  • cache: HTTP Large
  • wac: HTTP Small
  • adn: Application Delivery Network

EdgeCNAME

Replace this variable with the name of the edge CNAME for which real-time statistics will be returned.

Please verify that the case of the specified value matches the name assigned to the edge CNAME configuration.

Example:

?cname=cdn.example.com

CountryCode

Replace this variable with the ISO 3166 code corresponding to the country for which real-time statistics will be returned.

A list of country codes is available from the Country Codes (ISO 3166) article in the CDN Help Center.

Example:

&country=US

Request Headers

This endpointIdentifies a request's connection point to our REST API service. only takes advantage of common request headers.

Request Body

Request body parameters are not required by this endpoint.

Response

The response to the above request includes an HTTP status code, response headers, and a response body.

Status Code

A status code indicates whether the request was successfully performed.

Response Headers

The response for this endpoint only includes standard HTTP response headers.

View common response headers.

Response Body

The response body for a successful request that does not filter data contains response parameters that report statistics for:

Countries or edge CNAMEs through which traffic is not being served will be omitted from the response.

Name Data Type Description

Timestamp

String

Identifies the date and time for which real-time statistics was reported.

Format: MM\/DD\/YYYY hh:mm:ss

Time is indicated using 24-hour clock notation in UTC.

Learn more about date/time format.

Countries

Array

Contains real-time statistics for each country through which traffic was served.

CountryCode

String

Countries array

Indicates the scope for the RTStats array.

Valid values are:

  • Blank: A blank value indicates that the reported real-time statistics are for the entire network.
  • POP: If this response parameter is set to a two-letter country code, then real-time statistics are only being reported for that country location.

    View a list of country codes.

Country

String

Countries array

Indicates the scope for the RTStats array.

Valid values are:

  • Blank: A blank value indicates that the reported real-time statistics are for the entire network.
  • POP: If this response parameter is set to the name of a country, then real-time statistics are only being reported for that location.

RTStats

Array

Countries array

This response parameter contains summarized and country-specific real-time statistics for each qualifying edge CNAME. The scope for these statistics is determined by the Country response parameter.

ReportCode

String

Countries array > RTStats array

Determines the scope for which real-time statistics will be reported.

Valid values are:

  • Report Code: This term identifies an edge CNAME by its report code. Indicates that the current object reports real-time statistics for this edge CNAME.
  • Total: Indicates the current object reports real-time statistics for all traffic being delivered over the specified platform.

    Total traffic will not be reported when requesting real-time statistics for a specific edge CNAME using the cname query string parameter.

CName

String

Countries array > RTStats array

Determines the scope for which real-time statistics will be reported.

Valid values are:

  • Edge CNAME: This term identifies an edge CNAME by its name. Indicates that the current object reports real-time statistics for this edge CNAME.
  • Total: Indicates the current object reports real-time statistics for all traffic being delivered over the specified platform.

    Total traffic will not be reported when requesting real-time statistics for a specific edge CNAME using the cname query string parameter.

BW

Number

floating-point

Countries array > RTStats array

Indicates bandwidth, in bytes per second, for the scope defined by the Country and CName response parameters.

CONN

Number

floating-point

Countries array > RTStats array

Indicates the number of new connections per second for the scope defined by the Country and CName response parameters.

HITS

Number

floating-point

Countries array > RTStats array

Indicates the number of hits per second for the scope defined by the Country and CName response parameters.

CacheStats

Array

Countries array > RTStats array

This response parameter contains real-time statistics for cache status codes.

Key

String

Countries array > RTStats array > CacheStats array

Identifies a cache status code for which real-time statistics will be reported.

Valid values are:

Value

Number

floating-point

Countries array > RTStats array > CacheStats array

Indicates the number of requests per second that resulted in the cache status code identified by the Key response parameter for the scope defined by the Country and CName response parameters.

HttpStatuses

Array

Countries array > RTStats array

This response parameter contains real-time statistics for HTTP status codes.

Key

String

Countries array > RTStats array > HTTPStatuses array

Identifies a HTTP status code for which real-time statistics will be reported.

Valid values are:

  • http.2xx: 2xx status code (e.g., 200, 201, 202, etc.)
  • http.304: 304 Not Modified status code
  • http.3xx: 3xx status code (e.g., 300, 301, 302, etc.)

  • http.403: 403 Forbidden status code
  • http.404: 404 Not Found status code
  • http.4xx: 4xx status code (e.g., 400, 401, 402, 405, etc.)

  • http.5xx: 5xx status code (e.g., 500, 501, 502, etc.)
  • http.other: Identifies a status code that is not listed above.

Value

Number

floating-point

Countries array > RTStats array > HTTPStatuses array

Indicates the number of requests per second that resulted in the HTTP status code identified by the Key response parameter for the scope defined by the Country and CName response parameters.

Errors

The response body for an unsuccessful request may contain an error parameter that provides additional information.

View common error messages.

Sample Request and Response (JSON)

A sample JSON request is provided below.

GET https://api.edgecast.com/v2/reporting/customers/0001/countryrealtimestats/adn?cname=cdn.example.com&country=us/1.1

Authorization: TOK:12345678-1234-1234-1234-1234567890ab

Accept: application/json

Host:api.edgecast.com

A sample JSON response is provided below.

HTTP/1.1 200 OK

Cache-Control: private

Content-Type: application/json; charset=utf-8

Date: Thu, 15 Apr 2021 12:00:00 GMT

Content-Length: 942

{
	"Timestamp": "01\/18\/2024 22:00:29",
	"Countries": [{
			"CountryCode": "US",
			"Country": "United States",
			"RTStats": [{
					"ReportCode": "10012",
					"CName": "cdn.example.com",
					"BW": 57137424356.900772,
					"CONN": 6256.201794999999,
					"HITS": 103441.41254399999,
					"CacheStats": [{
							"Key": "cache.hit",
							"Value": 103055.56026999999
						}, {
							"Key": "cache.miss",
							"Value": 4.2333339999999993
						}, {
							"Key": "cache.none",
							"Value": 329.719241
						}, {
							"Key": "cache.xphit",
							"Value": 0.650001
						}, {
							"Key": "cache.xpmiss",
							"Value": 0.016667
						}
					],
					"HttpStatuses": [{
							"Key": "http.2xx",
							"Value": 103306.54617099995
						}, {
							"Key": "http.403",
							"Value": 134.166676
						}, {
							"Key": "http.304",
							"Value": 0.7
						}
					]
				}
			]
		}
	]
}