YahooArchive / boomerang

End user oriented web performance testing and beaconing
http://lognormal.github.com/boomerang/doc/
Other
1.18k stars 448 forks source link

t_page and t_resp not calculated when using Cookie #27

Closed solarice closed 12 years ago

solarice commented 12 years ago

I noticed that the following time values are not calculated when using the cookie, but they should be known:

t_page [optional] Time taken from the head of the page to page_ready. t_resp [optional] Time taken from the user initiating the request to the first byte of the response.

solarice commented 12 years ago

Investigated a bit and compared to what is done by Episodes, and found this "solution":

Add the start time to the head of the html:

< script > if (window.t_firstbyte === undefined) { var t_firstbyte = Number(new Date()); }

and

Pull that value when the WebTiming API is not available:

    else {
        BOOMR.warn("This browser doesn't support the WebTiming API", "rt");

        if (t_firstbyte) {
            this.responseStart = t_firstbyte;
        }
    }

Let me know your thoughts.

bluesmoon commented 12 years ago

That only works if boomerang is loaded right at the top of your document, and it still isn't the correct number (it includes latency for loading boomerang). Secondly, it pollutes the global namespace, and that's something a library should never do.

Solving this use case is something we've documented in a HOWTO doc here: http://yahoo.github.com/boomerang/doc/howtos/howto-4.html

Let me know if that doesn't solve it.