[Ganglia-developers] Ganglia web page load time
Hi all: I have a Ganglia page which takes quite a bit of time to load and I was wondering if anybody have any PHP code that will allow me to measure the load time and print this in the main page (much like the Downloading and parsing ganglia's XML tree took 0.0073s. line). I guess I could use some third-party plugins for Firefox or something for this, but thought it might be of general interest to put this in the main page... Thanks, Bernard - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers
Re: [Ganglia-developers] Ganglia web page load time
On Mon, Apr 7, 2008 at 2:02 PM, Bernard Li [EMAIL PROTECTED] wrote: Hi all: I have a Ganglia page which takes quite a bit of time to load and I was wondering if anybody have any PHP code that will allow me to measure the load time and print this in the main page (much like the Downloading and parsing ganglia's XML tree took 0.0073s. line). $start = microtime(); $end = microtime(); $delta = round($end - $start, 4); print Generating this page took $delta seconds; Have to make sure that this isn't called for every single graph though, since that's a waste. It should give one tenth of a millisecond precision (from the round(..., 4)) to match the XML output. Should be fairly simple to add. I guess I could use some third-party plugins for Firefox or something for this, but thought it might be of general interest to put this in the main page... Firebug will tell you. -- Jesse Becker GPG Fingerprint -- BD00 7AA4 4483 AFCC 82D0 2720 0083 0931 9A2B 06A2 - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers
Re: [Ganglia-developers] Ganglia web page load time
On Mon, Apr 7, 2008 at 2:28 PM, Bernard Li [EMAIL PROTECTED] wrote: On Mon, Apr 7, 2008 at 11:14 AM, Jesse Becker [EMAIL PROTECTED] wrote: $start = microtime(); $end = microtime(); $delta = round($end - $start, 4); print Generating this page took $delta seconds; How can you tell when $start and $end is? For instance I don't think you can pin that on header and footer since footer may be loaded *before* all the graphs are drawn. There isn't much else you can do that I can think of. From the point of view of the PHP code, once index.php can finished processing the footer information, that transaction is done. The graphs are all separate HTTP transactions, and requesting those is the duty of the web client. I can imagine a complicated set of checks to make sure that graphs are requested in due course, and report that time, but I don't think it would be pretty. I don't think that the pure PHP parts of Ganglia are all that slow--it don't do anything terribly complicated. If I'm reading the output from firebug correctly, generating the HTML took something like 20 miliseconds. The slow parts are in calling graph.php umpteen times, at upwards times ranging from 150ms to almost a full second. I expect that the delay is mostly from the actual rrdtool calls, as opposed to the processing done by PHP. Firebug will tell you. Will try that out. Also try the YSlow addon for Firebug, it is an interesting, and sometimes even useful, addition. -- Jesse Becker GPG Fingerprint -- BD00 7AA4 4483 AFCC 82D0 2720 0083 0931 9A2B 06A2 - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers