Returns the root node of the most recently loaded page. A node is a request/response pair which is illustrated as one element of the page-tree in TrueLog Explorer. Dependent of the setting specified by the call to WebSetOption, the returned node is either the first issued request (PAGE_STAT_FLAG_RedirChainOnlyFirst) or, if this request is redirected or retried, the last one when called with a value of PAGE_STAT_FLAG_RedirChainOnlyLast. The optional flag parameter can be used to overwrite the default flag value specified by the call to WebSetOption.
The return value is a node ID, which can be used in various other WebPageStatXXX calls.
To generally enable the 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().
WebAPI.bdh
WebPageStatGetRootNode( in nFlags: number optional ): number;
0 if the node could not be found
>0 otherwise
Parameter | Description |
---|---|
nFlags |
Specifies the various options used by the search for the root node. If this parameter is omitted, the default options specified by the call to WebSetOption(WEB_OPT_DETAILED_PAGE_STAT) are used. Otherwise, specify one of the following values:
|
dcltrans transaction TInit begin WebSetOption(WEB_OPT_DETAILED_PAGE_STAT, PAGE_STAT_FLAG_AllLoadedDocs); end TInit; transaction TWeb var nNode : number; fValue : float; sUrl : string; begin WebPageUrl("http://lab3/"); nNode := WebPageStatGetRootNode(); if nNode > 0 then WebPageStatGetNodeInfo(null, sUrl); print("Root Url: " + sUrl); if WebPageStatGetFirstFrame(nNode) > 0 then WebPageStatGetNodeData(STATFLAG_BytesSent, fValue); print("BytesSent: " + string(fValue)); end; end; end TWeb;