lighthouse使用

by Adam Henson

亚当·汉森(Adam Henson)

如何使用Lighthouse分析网站性能 (How to analyze website performance with Lighthouse)

手动,编程或自动审核网站性能 (Audit website performance manually, programmatically, or automatically)

Lighthouse is an open-source project by Google that gives you a way to measure web page performance. It has configurable settings for reproducing various conditions. You can set network and device type to simulate, for example.

Lighthouse是Google的一个开源项目,为您提供了一种衡量网页性能的方法。 它具有可重现各种条件的可配置设置。 例如,您可以设置网络和设备类型以进行仿真。

You give Lighthouse a URL to audit, it runs a series of audits against the page, and then it generates a report on how well the page did. From there, use the failing audits as indicators on how to improve the page. Each audit has a reference doc explaining why the audit is important, as well as how to fix it. Lighthouse

您为Lighthouse提供一个URL进行审核,它对页面进行一系列审核,然后生成有关页面效果的报告。 从那里开始,将失败的审核用作改进页面的指示。 每个审核都有一个参考文档,解释了为什么审核很重要以及如何解决它。 灯塔

There are many reasons why you’d want to measure performance, but one of the most important is about the impact on SEO. I go into more detail about this and how to address certain metrics in this article.

您有很多原因想要衡量性能,但是最重要的原因之一就是对SEO的影响。 我进入这个更多的细节和如何解决某些指标在这篇文章 。

使用Chrome DevTools运行Lighthouse (Running Lighthouse with Chrome DevTools)

You can run performance audits manually with the Chrome DevTools browser extension. Simply fire up the extension from the web page you’d like to test and select the “Audits” panel.

您可以使用Chrome DevTools浏览器扩展程序手动运行性能审核。 只需从您要测试的网页上启动该扩展程序,然后选择“审核”面板即可。

Among a variety of audits, you can choose “performance”. You can also choose to simulate device type and network throttling. Some information specifically about throttling can be found in the Lighthouse project Github repo.

在各种审核中,您可以选择“绩效”。 您还可以选择模拟设备类型和网络限制。 有关节流的一些特定信息可以在Lighthouse项目Github repo中找到 。

Click on “Run audits” next. Upon completion, Lighthouse provides a report within the extension UI.

单击“运行审核”。 完成后,Lighthouse将在扩展UI中提供报告。

This report is a general overview of important metrics, opportunities, and overall performance score. Thumbnails illustrate the lifecycle of page load. What does this all mean? Google provides a plethora of documentation describing each metric, how to address them and the overall performance score.

该报告是重要指标,机会和总体绩效得分的一般概述。 缩略图说明了页面加载的生命周期。 这是什么意思呢? Google提供了大量文档,描述每个指标 ,如何解决这些指标以及总体性能得分 。

In the top left side of Chrome DevTools panel is a download icon that you can use to download the full report in JSON format. You can then use it to create a PDF report via Lighthouse Report Viewer.

Chrome DevTools面板的左上方是一个下载图标,您可以使用该图标下载JSON格式的完整报告。 然后,您可以使用它通过Lighthouse Report Viewer创建PDF报告。

Due to the high volume of factors playing into the lifecycle of page load, it’s important to compare results in batches. Taking an average of 5 runs, for example, will provide better insight.

由于大量因素会影响页面加载的生命周期,因此批量比较结果非常重要。 例如,平均进行5次运行将提供更好的洞察力。

以编程方式运行Lighthouse (Running Lighthouse Programmatically)

For our standard “run of the mill” situations, the above should suffice. Another way to run Lighthouse involves installing the open-source package via NPM and following the instructions in the CLI documentation. This can be beneficial if you want to run audits programmatically in a build pipeline, for example.

对于我们的标准“工厂运行”情况,上述条件就足够了。 运行Lighthouse的另一种方法包括通过NPM安装开源软件包,并按照CLI文档中的说明进行操作。 例如,如果要在构建管道中以编程方式运行审核,这可能会很有用。

Similar to the above, you can also run Lighthouse in code by following the documentation for using the Node module programmatically. You could create a full-fledged Node.js application with Lighthouse ?!

与上述类似,您还可以通过遵循以编程方式使用Node模块的文档,在代码中运行Lighthouse。 您可以使用Lighthouse创建一个功能完善的Node.js应用程序?

随着时间的推移自动运行Lighthouse (Running Lighthouse Automatically Over Time)

So now that we’re pros — let’s take this to the next level. There are many integrations listed in the Lighthouse documentation, so let’s take a look at one of them.

因此,既然我们是专家,那就让我们进入一个新的高度。 Lighthouse文档中列出了许多集成 ,因此让我们看一下其中的一个。

使用“ Foo”运行Lighthouse并随时间比较结果 (Using “Foo” to Run Lighthouse and Compare Results Over Time)

In an engineering setting where many developers are deploying application changes on a regular basis, it can be important to monitor website performance over time to associate change sets with performance degradation or improvement. Another example would be teams that have initiatives to improve performance for SEO ranking or other reasons. In these situations, it’s critical to monitor website performance over days, weeks, months, etc.

在许多开发人员都定期部署应用程序更改的工程环境中,监视一段时间内的网站性能以将更改集与性能下降或改进相关联非常重要。 另一个示例是出于SEO排名或其他原因而主动提高绩效的团队。 在这种情况下,监视几天,几周,几个月等网站的性能至关重要。

You can add URLs to track at www.foo.software and monitor performance change. Foo also provides email, Slack or PagerDuty notifications when performance has dropped below a threshold defined by the user, when it’s back to normal, and when improvements are identified automatically!

您可以添加URL来跟踪www.foo.software并监视性能变化。 当性能下降到用户定义的阈值以下,恢复正常以及自动识别出改进时,Foo还提供电子邮件,Slack或PagerDuty通知。

The best part about it is that you can create an account for free! Once registered and logged in, click the “Pages” link from the top navigation. This is where you can add URLs to monitor. Foo saves results and displays a timeline chart providing a visualization of important metrics. You can toggle through days, weeks, months and drill into detailed reports.

最好的部分是您可以免费创建一个帐户 ! 注册并登录后,单击顶部导航中的“页面”链接。 您可以在此处添加要监视的URL。 Foo保存结果并显示时间线图表,以直观显示重要指标。 您可以在几天,几周,几个月之间切换,并深入查看详细的报告。

结论 (Conclusion)

Lighthouse is becoming an industry standard in website performance measurement. There are books worth documentation about Lighthouse that provides details of important metrics.

Lighthouse正在成为网站性能衡量的行业标准。 有一些有关Lighthouse的有价值的书籍,其中提供了重要指标的详细信息 。

翻译自: https://www.freecodecamp.org/news/three-ways-to-analyze-website-performance-with-lighthouse-8d100966c04b/

lighthouse使用

lighthouse使用_如何使用Lighthouse分析网站性能相关推荐

  1. 利用Performance API分析网站性能

    performance window.performance.timing对象包含了完整的网页加载性能数据, 下面详细介绍如何通过对象各个属性获取页面加载期间各个阶段的性能 页面加载的第一个时间点是n ...

  2. lighthouse使用_如何在CircleCI中使用Lighthouse

    lighthouse使用 CircleCI is a popular tool for orchestrating CI/CD pipelines. Lighthouse is an open-sou ...

  3. 性能测试回归测试_自动网站性能回归测试

    性能测试回归测试 by Adam Henson 亚当·汉森(Adam Henson) 如何使用Foo自动执行网站性能回归测试 (How to automate website performance ...

  4. 前端如何进行网站性能分析及优化性能

    目录 1.分析网站性能常用的方式 1.1 chrome dev Tools 1.2  Lighthouse 1.3 第三方收费方案 2.介绍一个常用的性能分析工具 LightHouse 2.1 特点: ...

  5. 网站性能评测工具YSlow的使用

    在前端开发中,常常需要评估页面内容大小,请求数量,以及JS,CSS,图片等各类型文件所占的大小,以及有没有可优化的空间.那么YSlow是您必不可少的选择. YSlow简介: YSlow是由Yahoo开 ...

  6. 使用WebPageTest、Lighthouse和Chrome DevTools评估网站性能

    目录 一:使用WebPageTest评估网站性能 二:使用Lighthouse分析性能 1.本地npm安装Lighthouse 2.Chrome DevTools中使用 三:使用Chrome DevT ...

  7. Hexo站点建设之——基于Lighthouse查看网站性能

    一 概述 查看网站相关信息常用的网站有: 站长之家-ping:ping检测,国内测速,国际测速,网站速度对比等 PageSpeed Insights:网站在移动设备和桌面设备的网页响应速度(墙) 爱测 ...

  8. 移动硬盘不可用_如何对您的网站执行移动可用性审核

    移动硬盘不可用 In the wake of 在之后 Mobilegeddon, ensuring a good experience for your mobile users is more im ...

  9. 网络推广专员浅析网络推广中如何分析网站建设水平孰优孰劣?

    随着网站建设开发技术的成熟,网站建设从业人员也越来越多,很多站长并不是专业从事网站建设工作是半路出家的,像这种半路出家的群体并不在少数,他们在经过网站建设知识的积累后正式进入网络推广市场.那么对于这部 ...

最新文章

  1. 个人作业-Week2:案例分析
  2. AOP日志-前置通知操作
  3. linux如何卸载自带的openJdk,并且安装jdk1.8
  4. aop注解配置切点 spring_springboot aop 自定义注解方式实现一套完善的日志记录
  5. 斯坦福2019秋季课程:图机器学习资料全公开
  6. 傅里叶变换 【完整版】
  7. python怎么读取csv文件-python3读取csv文件任意行列代码实例
  8. html兼容手机浏览器
  9. SharePoint 2013技巧分享系列 - 隐藏Blog和Apps左侧导航菜单
  10. OtterCTF 内存取证(1-5)
  11. SuperMap IClient for Leaflet 加载高斯克吕格投影三度分带CGCS2000大地坐标系WMTS服务
  12. canvas中文显示乱码 html5_HTML5 CANVAS:绘制文字
  13. 微信小程序——事件绑定
  14. 资产标签二维码方案设计
  15. 机房合作—SVN skipped remains conflicted
  16. 那些让我印象深刻的bug--04
  17. wifi 中间人攻击_公共wifi下的中间人攻击
  18. 信息时代,书香更宜人
  19. Jim Joseph加入Burson Cohn Wolfe,担任新设立的全球职位
  20. javaScripty笔记

热门文章

  1. ExecuteScalar()方法
  2. 测试相关各软件下载地址
  3. 给BindingNavigator加个保存按钮
  4. Unity ShaderLab特效教程 适用于贴图、sprite和ugui的2d着色器实例 代码+详解注释 【将贴图转为马赛克效果】
  5. 为何如此之快?ClickHouse的核心特性及架构
  6. 强贴,搜集的搞笑小短句!
  7. WebApp 开发框架推荐以及优缺点分析
  8. oppo手机一直开启usb调试
  9. newduba首页怎么去掉_解决Chrome浏览器主页被毒霸劫持/篡改
  10. 你带她满星通关,她为你笑靥如花|Cocos精品《保卫萝卜3》