WebPageStatGetNodeData Function

Action

Returns information about a node (specified by the node ID) that is returned by a previous WebPageStatXXX function call.

To generally enable extended page statistics functionality, call WebSetOption with an option of WEB_OPT_DETAILED_PAGE_STAT (for a detailed description of the various values see WebSetOption).

Include file

WebAPI.bdh

Syntax

WebPageStatGetNodeData(
   in  nOption : number,
   out fResult : float,
   in  nNode   : number optional ): boolean;

Return value

  • true if the information is retrieved successfully

  • false otherwise

Parameter Description
nOption

Specify one of the following values:

STATFLAG_TimerConnect
Sum of the duration, in seconds, of all TCP/IP connects.
STATFLAG_TimerSSLConnect
Sum of the duration, in seconds, of all SSL connects.
STATFLAG_TimerSend
Sum of the duration, in seconds, of all send operations.
STATFLAG_TimerServerBusy
Sum of all server-busy times, in seconds. Time measurement begins after the last packet is sent and ends when the first packet is received.
STATFLAG_TimerRecv
Sum of the duration, in seconds, of all receive operations.
STATFLAG_TimerDns
Sum of the duration, in seconds, of all domain name resolutions.
STATFLAG_TimerDoc
The duration of the whole server round-trip (starting with DNS time and stopping when with the last byte is received). If used on a calculated summary node this will be a summary of the individual node times.
STATFLAG_ConnectCount
Number of TCP/IP connects.
STATFLAG_ConnectCountFailed
Number of failed TCP/IP connects.
STATFLAG_ConnectCountRetries
Number of retried TCP/IP connects.
STATFLAG_BYTESSENT
Number of bytes sent to the server.
STATFLAG_BYTESRECEIVED
Number of bytes received from the server.
STATFLAG_CookiesSent
Number of sent cookies.
STATFLAG_CookiesReceived
Number of received cookies.
fResult Retrieves the result of the specified value.
nNode Specify the node ID of the node for which information is to be returned (possibly returned by a previous WebPageStatXXX function). Provide a value of PAGE_STAT_Calculated if data of the most recent calculated node should be returned (WebPageStatCalcSummaryNode). When this parameter is omitted, the most recently returned or calculated node is used.

Example

dcltrans
  transaction TInit
  begin
    WebSetOption(WEB_OPT_DETAILED_PAGE_STAT,
                 PAGE_STAT_FLAG_AllLoadedDocs);
  end TInit;

  transaction TWeb
  var
    nNode  : number;
    nNodes : number;
    fValue : float;
  begin
    WebPageUrl("http://lab3/");
    nNode := WebPageStatGetRootNode();
    if nNode > 0 then
      WebPageStatGetNodeData(STATFLAG_TimerServerBusy, fValue);
      print("ServerBusyTime [s]: " + string(fValue));
      nNodes := WebPageStatCalcSummaryNode(null, "image/*",
              PAGE_STAT_MATCH_WildcardNoCase);
      if nNodes > 0 then
        WebPageStatGetNodeData(STATFLAG_BytesSent, fValue,
                             PAGE_STAT_Calculated);
        print("Bytes sent for images: " + string(fValue));
      end;
    end;
  end TWeb;