har文件分析http

When I consider the performance of a website, several things come to mind. I think about looking at the requests of a page, understanding what resources are being loaded, and how long these resources take to be available to users.

当我考虑网站的性能时,会想到几件事。 我考虑查看页面的请求,了解正在加载哪些资源以及这些资源可供用户使用多长时间。

The network tab will give you a table containing all assets loaded on the page. It will also show you relevant information about the origin of those assets (domain, HTTP status code, size), who initiated the request, and the order in which they were loaded in a waterfall representation.

网络标签会为您提供一个表格,其中包含页面上加载的所有资产。 它还将向您显示有关这些资产的来源(域,HTTP状态代码,大小),发起请求的人以及以瀑布表示形式加载它们的顺序的相关信息。

You can add more information to this table by right-clicking one of the table headers and choosing other columns.

您可以通过右键单击表标题之一并选择其他列来向该表添加更多信息。

The size, time and waterfall columns will be crucial to understanding the performance of a page. The size value will present the gzipped size of the resource (when applicable), while the time column shows the total duration from the start of the request to the receipt of the final byte in the response.

大小,时间和瀑布列对于理解页面的性能至关重要。 size值将显示资源的压缩大小(如果适用),而time列显示从请求开始到响应中最后一个字节接收的总持续时间。

Last, but not least, the waterfall column demonstrates when the asset is loaded along with the other requests.

最后但并非最不重要的一点是,瀑布列说明了何时将资产与其他请求一起加载。

Performance improvements are noticeable by changes in your code/environment. So how do we keep track of what is being analyzed by the Network tab? By exporting the page in HAR format.

通过更改代码/环境,可以显着提高性能。 那么,我们如何跟踪“网络”选项卡正在分析的内容? 通过以HAR格式导出页面。

什么是HAR文件? (What is a HAR file?)

A HAR (short for HTTP Archive) file is a JSON file containing all information about a browser’s interactions with a page. It will contain the HTML document and its respective JS and CSS files.

HAR(HTTP存档的缩写)文件是一个JSON文件,其中包含有关浏览器与页面交互的所有信息。 它将包含HTML文档及其各自的JS和CSS文件。

Along with this content, a HAR file will also contain all headers’ information and the browser metadata (that is, the time of each request).

除此内容外,HAR文件还将包含所有标头的信息和浏览器元数据(即每个请求的时间)。

It is important to mention here that cookies and form data will also be logged in the file, so be careful to not include sensitive information (personal details, passwords, credit card numbers) while auditing pages.

在此必须提及,cookie和表单数据也将记录在文件中,因此在审核页面时请注意不要包含敏感信息(个人详细信息,密码,信用卡号)。

Also, you should audit pages in private windows, which avoids browser extensions. It's important to avoid a browser’s extensions since they may modify the loading times of a page.

另外,您应该在专用窗口中审核页面,这样可以避免浏览器扩展。 避免浏览器扩展很重要,因为它们可能会修改页面的加载时间。

生成HAR文件 (Generating HAR files)

谷歌浏览器 (Google Chrome)

  • Close all incognito windows in Google Chrome.关闭Google Chrome中的所有隐身窗口。
  • Open a new incognito window in Google Chrome.在Google Chrome浏览器中打开一个新的隐身窗口。
  • Go to View > Developer > Developers Tools.转到查看>开发人员>开发人员工具。
  • In the Developer Tools panel, choose the Network tab.在“开发人员工具”面板中,选择“网络”选项卡。
  • Check the Preserve Log and Disable cache checkboxes to record all interactions.选中保留日志和禁用缓存复选框以记录所有交互。
  • Refresh the page.刷新页面。
  • Click the Export HAR (down arrow icon) to export the HAR file.单击导出HAR(向下箭头图标)以导出HAR文件。
  • Save the HAR file.保存HAR文件。

火狐浏览器 (Firefox)

  • Close all private windows in Firefox.关闭Firefox中的所有私有窗口。
  • Open a new private window in Firefox.在Firefox中打开一个新的私有窗口。
  • Go to Tools > Developer > Network or ctrl-shift-E.转到工具>开发人员>网络或ctrl-shift-E。
  • Refresh the page.刷新页面。
  • In the Cog icon (upper right side of the page), choose Save All As Har.在齿轮图标(页面右上角)中,选择全部另存为Har。
  • Save the HAR file.保存HAR文件。

苹果浏览器 (Safari)

  • Ensure that Show Develop menu in menu bar checkbox is checked under Safari > Preferences > Advanced.确保在Safari>偏好设置>高级下选中了在菜单栏中的显示开发菜单复选框。
  • Choose File > Open New Private Window.选择“文件”>“打开新的专用窗口”。
  • Visit the web page where the issue occurs.访问发生问题的网页。
  • Choose Develop > Show Web Inspector. The Web Inspector window appears.选择“开发>显示Web检查器”。 出现“ Web检查器”窗口。
  • Refresh the page.刷新页面。
  • Click Export on the upper right side of the pane.单击窗格右上方的导出。
  • Save the HAR file.保存HAR文件。

读取HAR文件 (Reading HAR files)

Once you have a HAR file, you can try a few HAR viewers online. My personal favourite is the one created by Jan Odavarko.

拥有HAR文件后,您可以在线尝试一些HAR查看器。 我个人最喜欢的是Jan Odavarko创建的 。

What I like about this viewer in particular is the fact you can have multiple files open at the same time, which makes it easier to compare them.

我特别喜欢这个查看器,因为您可以同时打开多个文件,这使得比较它们变得更加容易。

使用HAR文件分析页面的性能 (Using HAR files to analyze the performance of a page)

HAR files can be useful to collect information about the assets of a page. Since you have detailed information about their content, you can compare what has improved (or in some cases, not improved) after a new feature is launched or a redesign is completed, for example.

HAR文件可用于收集有关页面资产的信息。 由于您具有有关其内容的详细信息,因此,例如,在启动新功能或完成重新设计后,您可以比较哪些方面有所改进(或在某些情况下没有改进)。

During my workflow, I like to keep track of the final size/time values of a few pages of the product that I am working on.

在工作流程中,我想跟踪正在处理的产品几页的最终大小/时间值。

更多信息 (More information)

  • Measure Resource Loading Times

    测量资源加载时间

  • HAR Viewer source code

    HAR Viewer源代码

Also posted on my blog. If you like this content, follow me on Twitter and GitHub. Cover photo by William Daigneault/Unsplash

也张贴在我的博客上 。 如果您喜欢此内容,请在Twitter和GitHub上关注我。 威廉·戴格诺 ( William Daigneault)/ Unsplash的封面照片

翻译自: https://www.freecodecamp.org/news/using-har-files-to-analyze-performance-over-time/

har文件分析http

har文件分析http_如何使用HAR文件分析一段时间内的性能相关推荐

  1. php utf-8读取,PHP读取文件,解决中文乱码UTF-8的方法分析

    PHP读取文件,解决中文乱码UTF-8的方法分析,方法,中文,操作技巧,文本,本文 PHP读取文件,解决中文乱码UTF-8的方法分析 易采站长站,站长之家为您整理了PHP读取文件,解决中文乱码UTF- ...

  2. 【Android 逆向】Android 系统中文件的用户和分组 ( 文件所有者与分组 | /sdcard/ 的文件分组 | /data/ 目录分析 | 用户类型 )

    文章目录 一.文件所有者与分组 二./sdcard/ 的文件分组 三./data/ 目录分析 四.用户类型 一.文件所有者与分组 使用 ls -l 命令 , 查看 Android 系统根目录 , 下图 ...

  3. scanner怎样回到文件开头_Radare2逆向分析dex/so/二进制等文件的使用方法

    git clone https://github.com/radareorg/radare2.git git pull r2pm init r2pm update sys/install.sh rad ...

  4. python爬虫今日头条_python爬虫—分析Ajax请求对json文件爬取今日头条街拍美图

    python爬虫-分析Ajax请求对json文件爬取今日头条街拍美图 前言 本次抓取目标是今日头条的街拍美图,爬取完成之后,将每组图片下载到本地并保存到不同文件夹下.下面通过抓取今日头条街拍美图讲解一 ...

  5. php excel中解析显示html代码_骑士cms从任意文件包含到远程代码执行漏洞分析

    前言 前些日子,骑士cms 官方公布了一个系统紧急风险漏洞升级通知:骑士cms 6.0.48存在一处任意文件包含漏洞,利用该漏洞对payload文件进行包含,即可造成远程代码执行漏洞.这篇文章将从漏洞 ...

  6. 【AWSL】之Linux文件系统与日志分析(inode、恢复EXT类型的文件、恢复XFS类型的文件)

    序言 这里我主要介绍Linux文件系统与日志分析 文件系统与日志分析 序言 一.inode与block 1. 概述 ①inode的内容 ②inode号码 ③文件存储 ④inode的大小 ⑤inode的 ...

  7. U-Boot源码目录分析(VScode工程创建及文件夹过滤)

    参考:U-Boot工程目录介绍 作者:一只青木呀 发布时间: 2020-10-21 14:47:30 网址:https://blog.csdn.net/weixin_45309916/article/ ...

  8. bsp的分析(其中使用buildroot文件夹建立rootfs)

    以下内容源于朱有鹏嵌入式课程的学习,如有侵权,请告知删除. 一.X210的bsp介绍 1.嵌入式linux产品的bsp介绍 ARM+linux形式的bsp,内容和结构都是相似的. bsp由芯片厂家或板 ...

  9. 生信分析过程中这些常见文件的格式以及查看方式你都知道吗?

    生信分析过程中,会与很多不同格式的文件打交道,除了原始测序数据fastq之外,还需要准备基因组文件fasta格式和基因注释文件gtf格式.在分析的过程中还会有众多中间文件的生成,如bed.bed12. ...

  10. 多线程读取大文件,尤其是对日志文件分析很有用。

    我在之前的公司里工作的时候,他们要求我做一个能够分析IIS日志的程序,可我做来做去,也只能做到,1个G的文件读取在140秒左右.愁了很久,想到了用多线程读取大文件的方法,又发现文件读取流可以有很多个, ...

最新文章

  1. 论CondConv、DynamicConv、DyNet的区别与联系
  2. ef mysql自动更新_EF Core中怎么实现自动更新实体的属性值到数据库
  3. 不定积分24个基本公式_高分攻略丨语文阅读理解的24个万能答题公式
  4. networkX如何读取存储图的二进制.dat文件
  5. arcgis-online-python-scripts
  6. 面向对象(匿名内部类重写多个方法调用)
  7. linux显示光盘命令行,使用wodim在命令行下烧录光盘
  8. oracle+solaris+密码,Oracle Solaris 10回滚补丁文件密码哈希泄露漏洞
  9. CSDN Markdown编辑器帮助文档
  10. JPDA 架构研究14 - Agent利用环境指针访问VM(对象管理篇)
  11. 将C/C++代码中的注释删除
  12. sql server 查询某个表被哪些存储过程调用
  13. 初触Python,关于pyquery解析html(百度贴吧)
  14. PHP基础知识点汇总(三)
  15. 基于FPGA/数字IC的数字信号处理课程
  16. win系统CH341驱动安装方法
  17. 记录团队日常工作清单用什么办公软件?
  18. problems encountered during text search
  19. php+html文本域,html的文本域和表单域
  20. 电商直播增加人气,留人技巧有哪些

热门文章

  1. 缠中说禅重新编排版《论语》(整理版)
  2. HTML+CSS+JavaScript实现打字小游戏
  3. python爬取股票历史数据_爬取股票历史数据并绘制K线图
  4. 怎样把ue4官方文档下载下来_ue4官方文档下载及翻译
  5. 2021年最值得推荐的5款在线文档制作工具,效率这块稳稳拿捏
  6. Cesium笔记(3):基本控件简介—ImageryProvider地图瓦片地图配
  7. 微软去年安全业务收入150亿美元、新勒索软件以威联通设备为目标|1月27日全球网络安全热点
  8. 使用Java制作一款简单的小游戏
  9. java学习资料整理(开发必备)
  10. python open函数关于w+ r+ 读写操作的理解