Quantcast
Channel: Silk Performer
Viewing all articles
Browse latest Browse all 4084

Wiki Page: How can BDL code be used to find the download times for individual page components, namely image files?

$
0
0
Whilst individual page component statistics can be viewed via the "Statistics" tab when the relevant .xlg file is loaded into TrueLog Explorer, you may wish to measure this data programmatically in your BDL code.. The functions WebPageStatGetRootNode and WebPageStatGetNodeData, introduced in SilkPerformer 7.1, are ideal. Please note that this is the recommended approach - it is technically incorrect to use "MeasureStart" / "MeasureStop" functions wrapped around a hardcoded WebPage call to an image file. benchmark SilkPerformerRecorder use "WebAPI.bdh" dcluser user VUser transactions TInit : begin; TWeb : 1; var dclrand dcltrans transaction TInit begin WebSetBrowser(WEB_BROWSER_MSIE6); WebModifyHttpHeader("Accept-Language", "en-gb"); // Use this option to enable the extended page statistics feature. // This allows for browsing of the page tree (as with TrueLog Explorer) // and retrieving similar data to that displayed on TrueLog Explorer's // Statistics tab. WebSetOption(WEB_OPT_DETAILED_PAGE_STAT, PAGE_STAT_FLAG_AllLoadedDocs); end TInit; transaction TWeb var // declare all variables nNode : number; nType : number; sUrl : string; nNodes : number; fValue : float; sTranName : string; begin // page to test WebPageUrl("http://www.yourtestsite.com/"); // use WebPageStatGetRootNode to identify node nNode := WebPageStatGetRootNode(); // count nodes nNodes := WebPageStatCountNodes(); // write count to output file Writeln("Number of Nodes:= "+String(nNodes)); // begin "while" loop nNode:=1; While nNode = nNodes Do // return statistics for each node component WebPageStatGetNodeInfo(nType,sUrl,Null, Null, Null, nNode); WebPageStatGetNodeData(STATFLAG_TimerDoc, fValue, nNode); Writeln("Url: " + sUrl); Writeln("Round-Trip Time: " + string(fValue)); nNode:=nNode+1; end; end TWeb; Old KB# 17463

Viewing all articles
Browse latest Browse all 4084

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>