WebPageStatistics Function

Action

Provides measurements for the last page-level function call.

Include file

WebAPI.bdh

Syntax

WebPageStatistics(
   in  nSource : number,
   in  nOption : number,
   out nResult : number): boolean;

Return value

  • true if the specified value was set

  • false otherwise

Parameter Description
nSource

Specifies for which documents to provide measurements. This parameter must be one of the following values:

STATFLAG_HTMLDOC
Provides measurements for all HTML documents.
STATFLAG_OTHERDOC
Provides measurements all types of documents except HTML documents.
STATFLAG_ALL
Provides measurements for all types of documents.
nOption

Can be set to one of the following values:

STATFLAG_HTTPREQUESTS
Number of requests without an "if-modified-since" header.
STATFLAG_CONDHTTPREQUESTS
Number of conditional requests; these are requests with an "if-modified-since" header.
STATFLAG_CACHEHITS
Number of cache hits; that is, when the requested document was found in the document cache and no request was sent to the server.
STATFLAG_HITSFAILED
Number of failed requests.
STATFLAG_1XX
Number of 1xx responses.
STATFLAG_2XX
Number of 2xx responses.
STATFLAG_3XX
Number of 3xx responses.
STATFLAG_4XX
Number of 4xx responses.
STATFLAG_5XX
Number of 5xx responses.
STATFLAG_TIMERCONNECT
Sum of the duration, in ms, of all TCP/IP connects.
STATFLAG_TIMERSSLCONNECT
Sum of the duration, in ms, of all SSL connects.
STATFLAG_TIMERSEND
Sum of the duration, in ms, of all send operations.
STATFLAG_TIMERSERVERBUSY
Sum of all server-busy times, in ms. The time measurement starts after the last packet was sent and stops when the first packet is received.
STATFLAG_TIMERRECV
Sum of the duration, in ms, of all receive operations.
STATFLAG_TIMERDNS
Sum of the duration, in ms, of all domain name resolutions.
STATFLAG_CONNECTCOUNT
Number of TCP/IP connects.
STATFLAG_SSLCONNECTCOUNT
Number of SSL connection handshakes; this is a subset of the STATFLAG_CONNECTCOUNT measurement.
STATFLAG_SENDCOUNT
Number of requests sent to the server.
STATFLAG_LINKS
Number of HTTP(S) links in the most recently downloaded Web page. The Link checking option must be enabled for this result to be available.
STATFLAG_LINKSWORKING
Number of working HTTP(S) links in the most recently downloaded Web page. The Link checking option must be enabled for this result to be available.
STATFLAG_BYTESSENT
Number of bytes sent to the server.
STATFLAG_BYTESRECEIVED
Number of bytes received from the server.
STATFLAG_TimeToFirstByte
Time from request start until the first response from the server arrives.
nResult Variable that receives the result.

Example

dcltrans
  transaction TMain
  var
    nResult: number;
  begin
    WebPageUrl("http://standardhost/");
    WebPageStatistics(STATFLAG_ALL, STATFLAG_TIMERSERVERBUSY, nResult);
    Print(string(nResult));
    WebPageStatistics(STATFLAG_HTMLDOC, STATFLAG_TIMERDNS, nResult);
    Print(string(nResult));
  end TMain;