har文件分析http_如何使用HAR文件分析一段時間內的性能

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

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/390208.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/390208.shtml
英文地址,請注明出處:http://en.pswp.cn/news/390208.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

第一階段:前端開發_Mysql——表與表之間的關系

2018-06-26 表與表之間的關系 一、一對多關系: 常見實例:分類和商品,部門和員工一對多建表原則:在從表(多方)創建一個字段,字段作為外鍵指向主表(一方)的一方      …

按鈕提交在url后添加字段_在輸入字段上定向單擊“清除”按鈕(X)

按鈕提交在url后添加字段jQuery makes it easy to get your project up and running. Though its fallen out of favor in recent years, its still worth learning the basics, especially if you want quick access to its powerful methods.jQuery使您可以輕松啟動和運行項目…

429. N 叉樹的層序遍歷

429. N 叉樹的層序遍歷 給定一個 N 叉樹,返回其節點值的層序遍歷。(即從左到右,逐層遍歷)。 樹的序列化輸入是用層序遍歷,每組子節點都由 null 值分隔(參見示例)。 - 示例 1:輸入…

javascript如何阻止事件冒泡和默認行為

阻止冒泡: 冒泡簡單的舉例來說,兒子知道了一個秘密消息,它告訴了爸爸,爸爸知道了又告訴了爺爺,一級級傳遞從而以引起事件的混亂,而阻止冒泡就是不讓兒子告訴爸爸,爸爸自然不會告訴爺爺。下面的d…

89. Gray Code - LeetCode

為什么80%的碼農都做不了架構師&#xff1f;>>> Question 89. Gray Code Solution 思路&#xff1a; n 0 0 n 1 0 1 n 2 00 01 10 11 n 3 000 001 010 011 100 101 110 111 Java實現&#xff1a; public List<Integer> grayCode(int n) {List&…

400. 第 N 位數字

400. 第 N 位數字 在無限的整數序列 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, …中找到第 n 位數字。 注意&#xff1a;n 是正數且在 32 位整數范圍內&#xff08;n < 231&#xff09;。 示例 1&#xff1a; 輸入&#xff1a;3 輸出&#xff1a;3 示例 2&#xff1a; 輸入&…

1.初識Linux

1.Linux 區分大小寫 2.shell命令行-bash 進入終端->[stulocalhost~]$ (其中,Stu為登錄用戶名&#xff0c;localhost為登錄主機名&#xff0c;’~’ 表示當前用戶正處在stu用戶的家目錄中, 普通用戶的提示符以$結尾&#xff0c;而根用戶以’#’結尾) 3.Linux中所謂的命令(…

這份NLP研究進展匯總請收好,GitHub連續3天最火的都是它

最近&#xff0c;有一份自然語言處理 (NLP) 進展合輯&#xff0c;一發布就受到了同性交友網站用戶的瘋狂標星&#xff0c;已經連續3天高居GitHub熱門榜首位。 合集里面包括&#xff0c;20多種NLP任務前赴后繼的研究成果&#xff0c;以及用到的數據集。 這是來自愛爾蘭的Sebasti…

基于模型的嵌入式開發流程_如何使用基于模型的測試來改善工作流程

基于模型的嵌入式開發流程Unit testing is not enough – so lets start using model-based testing to improve our workflows.單元測試還不夠–因此&#xff0c;讓我們開始使用基于模型的測試來改善我們的工作流程。 Software testing is an important phase in building a …

166. 分數到小數

166. 分數到小數 給定兩個整數&#xff0c;分別表示分數的分子 numerator 和分母 denominator&#xff0c;以 字符串形式返回小數 。 如果小數部分為循環小數&#xff0c;則將循環的部分括在括號內。 如果存在多個答案&#xff0c;只需返回 任意一個 。 對于所有給定的輸入…

最近用.NET實現DHT爬蟲,全.NET實現

最近用.NET實現DHT爬蟲&#xff0c;全.NET實現&#xff0c;大家可以加我QQ交流下 309159808 轉載于:https://www.cnblogs.com/oshoh/p/9236186.html

C++貪吃蛇

動畫鏈接 GitHub鏈接&#xff1a;https://github.com/yanpeng1314/Snake 1 #include "Snake.h"2 3 int iScore 0;4 int iGrade 1;5 6 //蛇頭蛇尾初始位置7 int x_head 1, y_head 3;8 int x_tail 1, y_tail 1;9 10 //地圖坐標11 int i_Map 1, j_Map 1;12 13 /…

遠程辦公招聘_招聘遠程人才時要尋找的5種技能

遠程辦公招聘Remote work is a fast emerging segment of the labor market. How to embrace this shift as an employer - and find, recruit, and empower remote staff - is a question many companies and hiring managers are grappling with.遠程工作是勞動力市場中快速崛…

10分鐘騰訊云配置免費https

騰訊云免費證書申請地址&#xff1a; https://console.cloud.tencent... 填寫相關信息 域名身份驗證 文件驗證 將fileauth.text 創建在網站訪問根目錄的 .well-known/pki-validation/目錄使得 www.**.com/.well-known/pki-validation/fileauth.text 能夠訪問詳情 等待5分鐘左右…

1588. 所有奇數長度子數組的和

1588. 所有奇數長度子數組的和 給你一個正整數數組 arr &#xff0c;請你計算所有可能的奇數長度子數組的和。 子數組 定義為原數組中的一個連續子序列。 請你返回 arr 中 所有奇數長度子數組的和 。 示例 1&#xff1a; 輸入&#xff1a;arr [1,4,2,5,3] 輸出&#xff1…

洛谷P3195 [HNOI2008]玩具裝箱TOY(單調隊列優化DP)

題目描述 P教授要去看奧運&#xff0c;但是他舍不下他的玩具&#xff0c;于是他決定把所有的玩具運到北京。他使用自己的壓縮器進行壓縮&#xff0c;其可以將任意物品變成一堆&#xff0c;再放到一種特殊的一維容器中。P教授有編號為1...N的N件玩具&#xff0c;第i件玩具經過壓…

680. 驗證回文字符串 Ⅱ

680. 驗證回文字符串 Ⅱ 給定一個非空字符串 s&#xff0c;最多刪除一個字符。判斷是否能成為回文字符串。 示例 1: 輸入: s “aba” 輸出: true 示例 2: 輸入: s “abca” 輸出: true 解釋: 你可以刪除c字符。 示例 3: 輸入: s “abc” 輸出: false 解題思路 使用…

Android--RxJava2更新體驗

截止日前最新版2017-3-15: RxJava compile ‘io.reactivex:rxjava:1.2.7’ compile ‘io.reactivex:rxandroid:1.2.1’ RxJava2 compile “io.reactivex.rxjava2:rxjava:2.0.7” compile “io.reactivex.rxjava2:rxandroid:2.0.1” 1:create操作改變 Rxjava CompositeSubscri…

kotlin和java語言_Kotlin VS Java – 2020年您應該學習哪種編程語言?

kotlin和java語言It has been several years since Kotlin came out, and it has been doing well. Since it was created specifically to replace Java, Kotlin has naturally been compared with Java in many respects.自Kotlin問世以來已經有好幾年了&#xff0c;而且一切…

oracle部署--安裝oracle軟件與部署單實例數據庫

一、安裝oracle數據庫軟件 1.創建相應的用戶組及用戶 groupadd oinstall groupadd oper groupadd dba useradd -g oinstall -G oper,dba oracle 2.創建oracle software安裝路徑 mkdir -p /u01/app/oracle/product/11.2.0/db_1 3.修改安裝路徑權限 chown -R oracle:oinstall …