简体   繁体   English

如何使用 Javascript(库)分析浏览器页面加载?

[英]How to profile browser page load using Javascript (Library)?

I've been doing a lot of research on this, but I figure I could crowd-source with what I have and see if anyone can offer additions to what I have.我一直在对此进行大量研究,但我认为我可以将我拥有的东西众包,看看是否有人可以为我拥有的东西提供补充。 So I want to be able to determine page load time using JS.所以我希望能够使用 JS 确定页面加载时间。 Not just page load as a single number, but as a breakdown.不仅页面加载作为单个数字,而且作为细分。

First what I found was a new W3C Specification (Draft): https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html首先我发现了一个新的 W3C 规范(草案): https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html

This would be perfect, however its limited to Chrome, and IE, and it's still inconsistent between the browsers.这将是完美的,但它仅限于 Chrome 和 IE,并且在浏览器之间仍然不一致。

But now I have found Real User Monitoring (RUM) by New Relic that is based off of a Javascript Library by Steve Souders.但是现在我发现了 New Relic 的 Real User Monitoring (RUM),它基于 Steve Souders 的 Javascript 库。 From what I can tell they can determine the same data that I saw from the new w3c Draft.据我所知,他们可以确定我从新的 w3c 草案中看到的相同数据。

It seems that they are using HTTP Archive: http://code.google.com/p/httparchive/似乎他们正在使用 HTTP 存档: http://code.google.com/p/httparchive/

However, I cannot seem to find any information on page performance or load, so I wasn't sure if I was looking at the correct library.但是,我似乎找不到任何有关页面性能或负载的信息,所以我不确定我是否正在查看正确的库。

Now of course, if there is anything else out there, that could provide more information on page profiling, I am welcomed to the information.现在当然,如果还有其他东西可以提供更多关于页面分析的信息,我很欢迎这些信息。

Have a look at Boomerang.js (https://github.com/yahoo/boomerang) by Yahoo.看看雅虎的 Boomerang.js (https://github.com/yahoo/boomerang)。

Should allow you to roll your own RUM and does graceful degradation so you should still get some information from browsers without navigation.timing.应该允许您滚动自己的 RUM 并进行优雅降级,因此您仍然应该从浏览器中获取一些信息,而无需使用 navigation.timing。

Also if you've got access to Windows have a play with dynatrace's tools - gives quite a good insight into what it going on during page load (in IE and FF)此外,如果您可以访问 Windows 可以使用 dynatrace 的工具 - 可以很好地了解页面加载期间发生的情况(在 IE 和 FF 中)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM