用于收集浏览器端性能信息的 JS 库(如 YSlow 或 FireBug“Net”?)

发布于 2024-10-02 09:53:02 字数 207 浏览 0 评论 0原文

是否有一个 JavaScript 库可以在网页加载时执行计时?例如,客户致电询问性能问题。我们告诉他们打开“调试”复选框,这会将浏览器性能信息发送回网络服务器,然后网络服务器会打电话回家。然后我们可以准确地看到他们的浏览器中发生了什么。

我对 FireBug“Net”选项卡或 YSlow 生成的内容感兴趣,无需客户安装任何内容或以任何方式修改他们的浏览器。存在吗(商业软件就可以)?

Is there a JavaScript library that can perform timing of the webpage when it loads? For example the customer calls with a performance problem. We tell them to turn on a "debug" checkbox, which would send browser performance info back to the web-server, and the web-server would then phone home. We can then see exactly what was happening in their browser.

I'm interested in something like what FireBug "Net" tab or YSlow produces, without requiring the customer to install anything or modify their browser in any way. Does it exist (commercial software is OK)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏见 2024-10-09 09:53:02

看看回旋镖 - http://yahoo.github.com/boomerang/doc/ 。您在页面中插入 JavaScript,它会将性能数据发送回您的服务器

Take a look at boomerang - http://yahoo.github.com/boomerang/doc/. You insert the javascript in your pages and it will send back performance data to your server

逐鹿 2024-10-09 09:53:02

据我所知,没有任何软件可以完成这项任务。我认为由于安全问题,无法通过网页上的通用算法来记录网络流量。事实上,Firebug 有一个 Bookmarklet 版本,众所周知,它充当网页的一部分,并且它具有大多数除网络面板之外的功能。

我的建议是网页的自我维护调试模式,因为它似乎是从网站收集数据的唯一方法。我们的想法是设置一个简单的计时器并保存页面加载的关键事件,最后将其发布到服务器以进行进一步处理。这可以是一个简单的 img 请求,例如 _tracker.gif?onload=4.3&domload=3.21&e1=0.4&e2=1.3

监听 window.onload 和 DOM 就绪 是相当常见的任务,并且相对容易完成。

其他自定义事件可以通过两种方式生成:

  • 带有 img.onload 处理程序的跟踪器图像,用于注册自开始以来经过的时间。这个想法是每个跟踪器图像代表页面加载期间的一个关键事件。
  • 将 onload 侦听器添加到某些资源本身。就像大脚本文件或图像一样。

在调试模式中也很重要的是捕获可能的错误。这可以通过 window.onerror 事件侦听器获得,大多数浏览器都支持该事件侦听器。

如果您想要更详细地记录网络流量,您还可以将 AJAX 处理程序包装到支持日志记录的管理器对象中。

There isn't any software up to this task that I'm aware of. Logging network traffic cannot be done by a general algorithm on a webpage due to security issues I think. In fact, Firebug has a Bookmarklet version, which is known to be act as part of the webpage, and it has most of the functionalities except the Net panel.

My suggestion would be a self-maintained debug mode of a webpage, because it seems to be the only way to collect data from the website. The idea would be to set up a simple Timer and save key events of the page load, finally post it to the server for further processing. This can be a simple request of an img for instance _tracker.gif?onload=4.3&domload=3.21&e1=0.4&e2=1.3

Listening for window.onload and DOM ready are rather common tasks, and are relatively easy to do.

The other custom events can be generated in two ways:

  • tracker image with img.onload handler that registers the time elapsed since the beginning. The idea is that each tracker image represents a key event during page load.
  • adding onload listeners to certain resources themselfs. Like big script files, or images.

What may also be essential in debug mode is catching possible errors. This can be obtained via the window.onerror event listener, which is supported is most browsers.

If you want more detailed logging of network traffic you may also wrap your AJAX hanlder into a manager object that supports logging.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文