使用适用于 SharePoint 的页面诊断工具Use the Page Diagnostics for SharePoint tool

本文介绍如何使用 适用于 SharePoint 的页面诊断工具根据预定义的性能标准集分析 SharePoint Online 新式和经典网站页面。This article describes how to use the Page Diagnostics for SharePoint tool to analyze SharePoint Online modern and classic site pages against a pre-defined set of performance criteria.

可针对以下安装适用于 SharePoint 的页面诊断工具:The Page Diagnostics for SharePoint tool can be installed for:

提示

版本 2.0.0 及更高版本包括对新式页面以及经典网站页面的支持。Version 2.0.0 and later includes support for modern pages in addition to classic site pages. 如果你不确定使用哪种版本的工具,可以选择"关于"链接或省略号 (...) 验证你的版本。 If you are unsure which version of the tool you are using, you can select the About link or the ellipses (...) to verify your version. 使用该工具时,始终 更新到最新版本。Always update to the latest version when using the tool.

适用于 SharePoint 的页面诊断工具是一款面向新 Microsoft Edge(https://www.microsoft.com/edge) 和 Chrome 浏览器)的浏览器扩展,可用于分析 SharePoint Online 新式门户和经典发布网站页面。The Page Diagnostics for SharePoint tool is a browser extension for the new Microsoft Edge (https://www.microsoft.com/edge) and Chrome browsers that analyzes both SharePoint Online modern portal and classic publishing site pages. 此工具仅适用于 SharePoint Online,不能用于 SharePoint 系统页面。This tool only works for SharePoint Online, and cannot be used on a SharePoint system page.

该工具将针对每个分析的页面生成一个报告,其中显示页面如何针对预定义的规则集执行,并显示测试的结果超出基线值时的详细信息。The tool generates a report for each analyzed page showing how the page performs against a pre-defined set of rules and displays detailed information when results for a test fall outside the baseline value. SharePoint Online 管理员和设计人员可以使用该工具对性能问题进行疑难解答,并确保新页面在发布之前已经过优化。SharePoint Online administrators and designers can use the tool to troubleshoot performance issues and to ensure that new pages are optimized prior to publishing.

页面诊断工具旨在仅分析 SharePoint 网站页面,而不是分析系统页面(如 allitems.aspxsharepoint.aspx)。The Page Diagnostics tool is designed to analyze SharePoint site pages only, not system pages such as allitems.aspx or sharepoint.aspx. 如果您尝试在系统页面或其他任何非网站页面上运行该工具,您将收到一条错误消息,提示无法针对该类型的页面运行该工具。If you attempt to run the tool on a system page or any other non-site page, you will receive an error message advising that the tool cannot be run for that type of page.

必须在 SharePoint 页面上运行Must run on a SharePoint page

此工具没有错误,因为评估库或系统页面没有任何价值。This is not an error in the tool as there is no value in assessing libraries or system pages. 请导航到 SharePoint 网站页面以使用该工具。Please navigate to a SharePoint site page to use the tool. 如果此错误发生在 SharePoint 页面上,请检查母版页以确保未删除 SharePoint 元标记。If this error occurs on a SharePoint page, please check the master page to ensure that the SharePoint metatags have not been removed.

若要提供有关工具的反馈,请选择工具右上角的省略号,然后选择"提供反馈"。To provide feedback about the tool, select the ellipsis at the top right corner of the tool and then select Give feedback.

提供反馈Give feedback

安装适用于 SharePoint 的页面诊断工具Install the Page Diagnostics for SharePoint tool

本节中的安装过程适用于 Chrome 和 Microsoft Edge 浏览器。The installation procedure in this section will work for both the Chrome and Microsoft Edge browsers.

重要

Microsoft 不会读取由适用于 SharePoint 的页面诊断工具分析的数据或页面内容,并且我们不会捕获任何个人信息、网站或下载信息。Microsoft does not read data or page content that is analyzed by the Page Diagnostics for SharePoint tool, and we do not capture any personal information, website or download information. 该工具记录到 Microsoft 的唯一可识别信息是租户名称、失败的规则计数以及工具运行的日期和时间。The only identifiable information logged to Microsoft by the tool is the tenant name, counts of rules that have failed and the date and time the tool was run. Microsoft 使用此信息来更好地了解新式门户和发布网站使用趋势以及常见的性能问题。This information is used by Microsoft to better understand modern portal and publishing site usage trends and common performance issues.

  1. 安装适用于 Microsoft Edge (Edge 扩展或 Chrome) Chrome 扩展 (SharePoint) 。Install the Page Diagnostics for SharePoint tool for Microsoft Edge (Edge extension) or Chrome (Chrome extension). 请查看应用商店中的说明页面上提供的用户隐私策略。Please review the User Privacy Policy provided on the description page in the store. 将工具添加到浏览器时,你将看到以下权限通知。When adding the tool to your browser, you will see the following permissions notice.

    扩展权限Extension permissions

    此通知就位是因为页面可能包含 SharePoint 外部位置的内容,具体取决于页面上的 Web 部件和自定义项。This notice is in place because a page may contain content from locations outside of SharePoint depending on the web parts and customizations on the page. 这意味着该工具将在单击"开始"按钮时读取请求和响应,并且仅适用于运行该工具的活动"SharePoint"选项卡。This means that the tool will read the requests and responses when the start button is clicked and only for the active SharePoint tab where the tool is running. 此信息由 Web 浏览器本地捕获,并且可通过工具的"网络跟踪"选项卡中的"导出到 JSON" 或"导出到 HAR" 按钮 提供给你。 该信息不会发送到 Microsoft 或由 Microsoft 捕获。This information is captured locally by the web browser and is available to you via the Export to JSON or Export to HAR button in the tool's Network trace tab. The information is not sent to or captured by Microsoft. (该工具遵守可在此处访问的 Microsoft 隐私策略) (The tool respects the Microsoft privacy policy accessible here.)

    " 管理下载" 权限涵盖了工具的 "导出到 JSON"功能的 使用。The Manage your downloads permission covers use of the tool's Export to JSON functionality. 在组织外部共享 JSON 文件之前,请遵循贵公司的隐私准则,因为结果包含 URL,并且可将其分类为个人身份信息 (PII) 。Please follow your company's own privacy guidelines before sharing the JSON file outside of your organization, as the results contain URLs and that can be classified as PII (Personally Identifiable Information).

  2. 如果要在 Incognito 或 InPrivate 模式下使用该工具,请按照浏览器的过程操作:If you want to use the tool in Incognito or InPrivate mode, follow the procedure for your browser:

    1. 在 Microsoft Edge中,导航到"扩展"或 edge://extensions URL 栏中键入"扩展",然后选择 "扩展 的详细信息"。In Microsoft Edge, navigate to Extensions or type edge://extensions in the URL bar and select Details for the extension. 在扩展设置中,选中 InPrivate 中的"允许"复选框In the extension settings, select the checkbox for allow in InPrivate.
    2. 在 Chrome 中,导航到"扩展"或chrome://extensions URL 栏中键入"扩展",然后选择 "扩展 的详细信息"。In Chrome, navigate to Extensions or type chrome://extensions in the URL bar and select Details for the extension. 在扩展设置中,选择允许 Incognito 中的滑块In the extension settings, select the slider for allow in Incognito.
  3. 导航到 SharePoint Online 上要查看的 SharePoint 网站页面。Navigate to the SharePoint site page on SharePoint Online that you would like to review. 我们已允许在页面上"延迟加载"项目;因此,该工具不会自动停止 (这是为适应所有页面加载方案) 。We have allowed for "delay loading" of items on pages; therefore, the tool will not stop automatically (this is by design to accommodate all page load scenarios). 若要停止集合,请选择"停止 "。To stop collection, select Stop. 请确保在停止数据收集之前已完成页面加载,否则您将只捕获部分跟踪。Make sure that the page load has completed before you stop data collection or you will only capture a partial trace.

  4. 单击扩展的工具栏按钮Click on the extension's toolbar button SharePoint 页面诊断徽标 加载该工具,你将被显示以下扩展弹出窗口:to load the tool and you will be presented with the following extension popup window:

    页面诊断工具弹出窗口

选择 " 开始"开始收集数据进行分析。Select Start to begin collecting data for analysis.

你将在 SharePoint 页面诊断工具中看到的内容What you'll see in the Page Diagnostics for SharePoint tool

  1. 单击工具右上角 (...) 省略号以查找以下链接:Click the ellipses (...) in the top right corner of the tool to find the following links:

    1. " 其他资源 "链接提供有关工具的一般指南和详细信息,包括本文的链接。The Additional resources link provides general guidance and details regarding the tool including a link back to this article.
    2. " 提供反馈 "链接提供 指向 SharePoint 网站和协作用户语音网站 的链接。The Give feedback link provides a link to the SharePoint Sites and Collaboration User Voice site.
    3. " 关于 "链接包括当前安装的工具版本和指向工具的第三方通知的直接链接。The About link includes the currently installed version of the tool and a direct link to the tool's third party notice.
  2. 相关 ID、SPRequestDuration、SPIISLatency、****页面 加载时间和 URL 详细信息是信息性的,可用于几个目的。The Correlation ID, SPRequestDuration, SPIISLatency, Page load time, and URL details are informational and can be used for a few purposes.

    页面诊断详细信息Page diagnostics details

    • CorrelationID 是使用 Microsoft 支持时的重要元素,因为它允许他们收集特定页面的其他诊断数据。CorrelationID is an important element when working with Microsoft Support as it allows them to gather additional diagnostic data for the specific page.
    • SPRequestDuration 是 SharePoint 处理页面所花时间。SPRequestDuration is the time taken for SharePoint to process the page. 结构导航、大型图像和大量 API 调用都可能导致持续时间较长。Structural navigation, large images, lots of API calls could all contribute to longer durations.
    • SPIISLatency 是 SharePoint Online 开始加载页面所用的时间(以毫秒为单位)。SPIISLatency is the time in milliseconds taken for SharePoint Online begin loading the page. 此值不包括 Web 应用程序响应所花时间。This value does not include the time taken for the web application to respond.
    • 页面加载 时间是页面从请求时间到接收响应并呈现在浏览器中时记录的总时间。Page load time is the total time recorded by the page from the time of the request to the time the response was received and rendered in the browser. 此值受各种因素影响,包括网络延迟、计算机的性能以及浏览器加载页面所花的时间。This value is affected by a variety of factors including network latency, the performance of the computer and the time it takes for the browser to load the page.
    • (定位器) Url 是当前页面的 Web 地址。The Page URL (Uniform Resource Locator) is the web address of the current page.
  3. "诊断测试"选项卡按三个类别显示分析结果;无需任何操作改进机会****和关注也是必需的The Diagnostic tests tab displays the analysis results in three categories; No action required, Improvement opportunities and Attention required. 每个测试结果由这些类别中的某个项目表示,如下表所述:Each test result is represented by an item in one of these categories as described in the following table:

    类别Category 颜色Color 说明Description
    需要关注Attention required 红色Red 测试结果超出基线值,并且会影响页面性能。Test result falls outside the baseline value and is affecting page performance. 按照修正指南操作。Follow remediation guidance.
    改进机会Improvement opportunities 黄色Yellow 测试结果超出基线值,可能导致性能问题。Test result falls outside the baseline value and could be contributing to performance issues. 测试特定的条件可能适用。Test-specific criteria may apply.
    不需要执行任何操作No action required 绿色Green 测试结果在测试的基线值之内。Test result falls within the test's baseline value.

    页面诊断Page diagnostics

  4. " 网络跟踪 "选项卡提供有关页面生成请求和响应的详细信息。A Network trace tab provides details about page build requests and responses.

如何使用"诊断测试"选项卡How to use the Diagnostic tests tab

使用适用于 SharePoint 的页面诊断工具分析 SharePoint 新式门户页面或经典发布网站页面时,会使用预定义的规则来分析结果,这些规则将结果与基线值进行比较,并显示在"诊断测试"选项卡中。某些测试的规则可能会对新式门户和经典发布网站使用不同的基线值,具体取决于这两者的特定性能特征如何不同。When you analyze a SharePoint modern portal page or classic publishing site page with the Page Diagnostics for SharePoint tool, results are analyzed using pre-defined rules that compare results against baseline values and displayed in the Diagnostic tests tab. Rules for certain tests may use different baseline values for modern portal and classic publishing sites depending on how specific performance characteristics differ between the two.

显示在"改进机会"或"需要关注"类别中的测试结果指示了应针对建议做法进行审阅的区域,并且可以通过选择这些区域来显示有关结果的其他信息。Test results that appear in the Improvement opportunities or Attention required categories indicate areas that should be reviewed against recommended practices, and can be selected to display additional information about the result. 每个项目的详细信息包括" 了解详细信息 "链接,该链接将引导你直接查看与测试相关的相应指导。Details for each item include a Learn more link which will take you directly to the appropriate guidance related to the test. 显示在"不需要操作 " 类别中的测试结果表示符合相关规则,并且选中后不显示其他详细信息。Test results that appear in the No action required category indicate compliance with the relevant rule and do not display additional details when selected.

"诊断测试"选项卡中的信息不会告诉您如何设计页面,但会突出显示可能会影响页面性能的因素。The information in the Diagnostics tests tab will not tell you how to design pages, but will highlight factors that may impact page performance. 某些页面功能和自定义项对页面性能具有无法避免的影响,如果它们的影响很大,应该从页面中查看可能的修正或遗漏。Some page functionality and customizations have an unavoidable impact on page performance, and should be reviewed for potential remediation or omission from the page if their impact is substantial.

红色或黄色结果也可能指示刷新数据的 Web 部件过于频繁。Red or yellow results may also indicate web parts that refresh data too frequently. 例如,公司新闻不是每秒钟更新一次,但自定义 Web 部件通常构建为每秒获取一次最新新闻,而不是实现可改善整体用户体验的缓存元素。For example, corporate news is not updated every second but custom web parts are often built to fetch the latest news every second instead of implementing caching elements that could improve the overall user experience. 请记住,在页面上包括 Web 部件时,通常有一些简单的方法可以评估每个可用参数的值来降低其性能影响,以确保为达到预期目的正确设置它。Keep in mind when including web parts on a page that there are often simple ways to reduce their performance impact by evaluating the value of each available parameter to ensure it is set appropriately for its intended purpose.

备注

未启用发布功能的经典团队网站无法使用 CDN。Classic team sites that don't have the publishing feature enabled cannot make use of CDNs. 在这些网站上运行该工具时,CDN 测试应该会失败,可以忽略,但其余所有测试都适用。When you run the tool on these sites, the CDN test is expected to fail and can be ignored, but all of the remaining tests are applicable. SharePoint 发布功能的其他功能可能会增加页面加载时间,因此不应仅为了允许 CDN 功能而启用此功能。The additional functionality of the SharePoint publishing feature can increase page load times, so it should not be enabled just to allow CDN functionality.

重要

测试规则会定期添加和更新,因此请参考该工具的最新版本,了解有关当前规则和测试结果中包含的特定信息的详细信息。Test rules are added and updated regularly so please refer to the latest version of the tool for details about current rules and specific information included in test results. 可以通过管理扩展验证版本,扩展将告知更新是否可用。You can verify the version by managing your extensions and the extension will advise whether an update is available.

如何使用"网络跟踪"选项卡以及如何导出 HAR 文件How to use the Network Trace tab and how to export a HAR file

" 网络跟踪 "选项卡提供有关生成页面的请求和从 SharePoint 收到的响应的详细信息。The Network Trace tab provides detailed information about both requests to build the page and the responses received from SharePoint.

  1. 查找标记为红色 的项目加载时间Look for item load times flagged as red. 每个请求和响应都经过颜色编码,以使用下列延迟指标指示对整体页面性能的影响:Each request and response is color coded to indicate its impact on overall page performance using the following latency metrics:

    • 绿色 < :500 毫秒Green: < 500ms
    • 黄色:500-1000msYellow: 500-1000ms
    • 红色 > :1000 毫秒Red: > 1000ms

    网络跟踪Network Trace

    在以上图像中,红色项目与默认页面相关。In the image shown above, the red item pertains to the default page. 除非页面在 1000 毫秒内加载, (少于 < 1 秒,否则) 。It will always show red unless the page loads in < 1000ms (less than 1 second).

  2. 测试项目加载时间Test item load times. 在某些情况下,没有时间或颜色指示器,因为浏览器已缓存项目。In some cases there will be no time or color indicator because the items have already been cached by the browser. 若要正确测试这一点,请打开页面,清除浏览器缓存,然后单击"开始",因为这会强制加载"冷"页面,并真正反映初始页面加载。To test this correctly, open the page, clear browser cache, and then click Start as that will force a "cold" page load and be a true reflection of the initial page load. 然后,这应该与"温"页面负载进行比较,因为这也将有助于确定正在页面上缓存哪些项目。This should then be compared to the "warm" page load as that will also help determine what items are being cached on the page.

  3. 与可以帮助调查问题的其他人共享相关详细信息Share relevant details with others who can help investigate issues. 若要与开发人员或技术支持人员共享此工具中提供的详细信息或信息,建议使用"允许导出到 HTTP 存档" (HAR) 推荐方法。To share the details or information provided in the tool with your developers or a technical support person, using the Enable exporting to HTTP Archive (HAR) is the recommended approach.

    允许导出到 HAREnable exporting to HAR

这应在单击"开始"之前启用,这将在浏览器中启用调试模式。That should be enabled prior to clicking Start, which will then enable debug mode in your browser. 它将在 HAR (HTTP 存档) ,然后可以通过"网络跟踪"选项卡访问该文件。单击"导出到 HAR",它会将文件下载到计算机,然后你可以进行相应的共享。It will generate an HTTP Archive file (HAR) which can then be accessed through the "Network Trace" tab. Click the "Export to HAR" and it will download the file to your computer and you can then share it accordingly. 该文件可以在各种调试工具(如 F12 开发人员工具和 Fiddler)中打开。The file can be opened in a variety of debug tools, like F12 Developer Tools and Fiddler.

网络跟踪Network trace

重要

这些结果包含 URL,可将其分类为个人身份 (个人身份信息的 PII) 。These results contain URLs and that can be classified as PII (Personally Identifiable Information). 在分发该信息之前,请务必遵循组织的准则。Make sure to follow your organization's guidelines before distributing that information.

与 Microsoft 支持人员合作Engaging with Microsoft Support

我们包含了 Microsoft 支持级别 功能,该功能仅在直接处理支持案例时使用。We have included a Microsoft Support level feature that should only be utilized when working directly on a support case. 在没有支持团队参与的情况下使用此功能不会为您提供任何好处,并且会使页面执行速度明显变慢。Utilizing this feature will provide no benefit to you when used without support team engagement, and can make the page perform significantly slower. 当在工具中使用此功能时,无需其他信息,因为其他信息会添加到服务中的日志记录中。There is no additional information when using this feature in the tool as the additional information is added to the logging in the service.

没有任何变化,只是会通知你已启用它,并且页面性能将显著降低 2-3 倍于启用性能。No change is visible except that you will be notified that you have enabled it and your page performance will be significantly degraded by 2-3 times slower performance whilst enabled. 它仅与特定页面和该活动会话相关。It will only be relevant for the particular page and that active session. 因此,应谨慎使用,且仅在积极提供支持时使用。For this reason, this should be used sparingly and only when actively engaged with support.

启用 Microsoft 支持级别功能To enable the Microsoft Support level feature

  1. 打开"SharePoint 页面诊断"工具。Open the Page Diagnostics for SharePoint tool.

  2. 在键盘上,按 Alt-Shift-L。On your keyboard, press ALT-Shift-L. 这将显示" 启用支持日志记录" 复选框。This will display the Enable support logging check box.

  3. 选中该复选框,然后单击 "开始" 以重新加载页面并生成详细日志记录。Select the check box, and then click Start to reload the page and generate verbose logging.

    支持选项已启用Support Option Enabled

    你应该注意显示在 (应用程序顶部的 CorrelationID) 并将其提供给你的支持代表,以便他们能够收集有关诊断会话的其他信息。You should note the CorrelationID (displayed at the top of the tool) and provide it to your support representative to enable them to gather additional information about the diagnostic session.

优化 SharePoint Online 性能Tune SharePoint Online performance

优化 Office 365 性能Tune Office 365 performance

新式 SharePoint 体验中的性能Performance in the modern SharePoint experience

内容分发网络Content delivery networks

结合使用 Office 365 内容分发网络和 SharePoint OnlineUse the Office 365 Content Delivery Network (CDN) with SharePoint Online