如何:使用 Microsoft Excel 建立負載測試效能報告How to: Create load test performance reports using Microsoft Excel

您可以根據兩個或多個測試結果,產生 Microsoft Excel 負載測試報告。You can generate Microsoft Excel load test reports that are based on two or more test results.

注意

Web 效能和負載測試功能已淘汰。Web performance and load test functionality is deprecated. Visual Studio 2019 會是最後一個能使用 Web 效能和負載測試的版本。Visual Studio 2019 is the last version where web performance and load testing will be available. 如需詳細資訊,請參閱雲端式負載測試服務生命週期結束部落格文章。For more information, see the Cloud-based load testing service end of life blog post.

共有兩種負載測試報告可供使用:Two types of load test reports are available:

  • 執行比較:這會建立一組報告,這些報告會使用表格和橫條圖比較兩個負載測試結果中的資料。Run comparison This creates a set of reports that compares the data from two load test results using tables and bar charts.

  • 趨勢:您可以為兩個以上的負載測試結果產生趨勢分析。Trend You can generate trend analysis on two or more load test results. 結果會以折線圖顯示,但也可以利用樞紐分析表使用資料。The results are displayed using line charts, but the data is available in pivot tables.

提示

您也可以透過從摘要檢視、圖形檢視和資料表檢視複製並貼上資料,手動建立 Microsoft Word 報告。You can also manually create Microsoft Word reports by copying and pasting data from the summary view, graphs view, and tables view. 請參閱如何:使用 Microsoft Word 手動建立負載測試效能報告See How to: Manually create a load test performance report using Microsoft Word.

上述兩種報告都能用來與專案關係人共用效能資料,傳達出整體效能和系統的健康狀況是變好還是變差。Either report can be used to share performance data with stakeholders and convey whether the overall performance and health of the system is getting better or worse.

報告定義儲存在負載測試資料庫中。Report definitions are stored in the load test database. 儲存報告時,報告的定義是儲存在資料庫中,稍後可以重複使用。When a report is saved, the definition for the report is saved in the database and can be re-used later.

此外,也能和專案關係人共用 Excel 活頁簿,因此專案關係人不必連接至資料庫就能查看報告。Also, the Excel workbook can be shared with stakeholders so that stakeholders do not have to connect to the database to see the report.

注意

您可以共用 Excel 活頁簿,不過只有電腦上已安裝 Visual Studio 的使用者能夠修改任何試算表。You can share the Excel workbook; however, only users who have Visual Studio installed on their machine will be able to modify any of the spreadsheets. 其他使用者不會在 [Office] 功能區中看見 [負載測試報告],但是可以檢視活頁簿。Other users will not see the Load Test Report option in the Office ribbon, but they will be able to view the workbook.

下圖是顯示異動 (更新購物車) 速度下降和 (% Processor) 計數器變差之相關性的報告範例。The following illustration is an example of a report that shows a correlation between a decline in transaction (Update Cart) speed and the degeneration of the (% Processor) counter. 這指出應用程式的程式碼可能出現問題,而不是資料庫或網路問題,而且是使用 ASP.NET 分析工具診斷的絕佳候選對象。This points to a potential problem in the application code, instead of the database or network, and is a good candidate to diagnose by using the ASP.NET Profiler.

應用程式程式碼中的潛在問題

產生 Excel 報表的方法包括:在 [負載測試分析器] 中使用工具列的 [建立 Excel 報表] 按鈕,或在 Excel 中使用 [Office] 功能區的 [負載測試] 索引標籤中的 [負載測試報告] 選項。Excel reports can either be generated in the Load Test Analyzer, by using the Create Excel Report button in the toolbar, or from Excel by using the Load Test Report option in the Load Test tab of the Office ribbon.

注意

如果您將註解新增至負載測試,這些註解就會顯示在 Excel 報表中。If you add comments to a load test, they appear in the Excel report.

若要使用 Excel 產生負載測試比較報告To generate load test comparison reports using Excel

  1. 在產生報告前,首先您必須執行負載測試。Before you generate a report, you must first run a load test.

  2. 有兩種方式可以建立 Excel 負載測試報告:You can create Excel load test reports in two ways:

    • 完成負載測試後,在 [負載測試結果] 頁面中,選擇工具列的 [建立 Excel 報表] 按鈕。After you complete a load test, in the Load Test Results page, choose the Create Excel Report button in the toolbar.

      注意

      如果 [ Web 效能測試結果檢視器] 工具列中的 [建立 excel 報表] 按鈕已停用,您可能需要在啟用 Microsoft Excel 前一次執行。If the Create Excel Report button is disabled in the Web Performance Test Results Viewer toolbar, you may need to run Microsoft Excel one time before it is enabled. 安裝 Visual Studio Enterprise 時,會將 Visual Studio Enterprise 負載測試增益集複製到您的電腦以供 Microsoft Excel 使用,但這個增益集的安裝程序要到執行 Microsoft Excel 後才算完成。When Visual Studio Enterprise is installed, the Visual Studio Enterprise load test add-in is copied to your computer for Microsoft Excel; however, Microsoft Excel must be run to complete the installation process for the add-in.

      Microsoft Excel 隨即開啟 [產生負載測試報告精靈]。Microsoft Excel opens with the Generate a Load Test Report Wizard.

    OROR

    1. 開啟 Microsoft Excel,選取 [Office] 功能區中的 [負載測試] 索引標籤,然後選擇 [負載測試報告]。Open Microsoft Excel, select the Load Test tab in the Office ribbon and then choose Load Test Report.

      [產生負載測試報告精靈] 隨即出現。The Generate a Load Test Report Wizard appears.

    2. 在 [選取包含負載測試的資料庫] 頁面的 [伺服器名稱] 下,鍵入包含負載測試結果的伺服器名稱。In the Select database which contains load tests page, under Server name, type the name of the server containing the load test results.

    3. 在 [資料庫名稱] 下拉式清單中,選取包含負載測試結果的資料庫。In the Database name drop-down list, select the database containing the load test results.

  3. 在 [您要如何產生報告?] 頁面中確認已選取 [建立報告],然後選擇 [下一步]。In the How do you want to generate your report page, verify that Create a report is selected and choose Next.

  4. 在 [您要產生哪一種報告?] 頁面中確認已選取 [執行比較],然後選擇 [下一步]。In the What type of report do you want to generate page, verify that Run comparison is selected and choose Next.

  5. 在 [輸入負載測試報告詳細資料] 頁面的 [報告名稱] 中,鍵入報告的名稱。In the Enter load test report details page, type a name for your report in Report Name.

  6. 選取要產生報告的負載測試,然後選擇 [下一步]。Select the load test you want to generate the report for and choose Next.

  7. 在 [選取報告的回合] 頁面的 [選取一或多個要新增報告的回合] 下方,選取您要在報告中比較的兩個負載測試結果,然後選擇 [下一步]。In the Select the runs for your report page, under Select one or more runs to add to the report, select two load test results that you want to compare in the report and choose Next.

    注意

    您只能為兩個負載測試結果產生比較報告。You can only generate a comparison report on two load test results. 如果選取一個或超過兩個的負載測試結果,則會出現警告訊息。If you select either one load test result or more than two load test results, a warning message will appear.

  8. 在 [ 選取報表的計數器 ] 頁面的 [ 選取一或多個要加入至報表的計數器 ] 下,可以使用可展開的計數器清單來自訂報表。In the Select the counters for your report page, under Select one or more counters to add to the report an expandable list of counters is available to customize your report. 在報告中,從兩個已選取之測試回合選取您要比較的計數器,然後選擇 [完成]。Select the counters that you want to compare from the two selected test runs in the report and choose Finish.

  9. 隨即產生 Excel 活頁簿報告,其中包含下列試算表索引標籤:The Excel workbook report is generated with the following spreadsheet tabs:

    • 目錄 - 顯示負載測試報告名稱,並提供可連結至報告中各索引標籤的目錄。Table of Contents - Displays the load test report name and provides a table of contents with links to the various tabs in the report.

    • 回合 - 提供報告中兩個進行比較之回合的詳細資料。Runs - Provides details on which two runs are being compared in the report.

    • 測試比較 - 提供兩個比較回合間效能衰退和改進的橫條圖詳細資料。Test Comparison - Provides bar graph details on performance regressions and improvements between the two runs being compared.

    • 頁面比較 - 提供兩個回合在各測試回合頁面上的橫條圖和百分比效能比較資料。Page Comparison - Provides bar graph and percentage performance comparison data between the two runs on the various pages in the test runs.

    • 電腦比較 - 根據所使用電腦,提供兩個回合間的比較資料。Machine Comparison - Provides comparison data between the two runs based on the machines that were used.

    • 錯誤比較 - 比較兩個回合間所遇到的錯誤類型以及發生次數。Error Comparison - Compares the error types encountered between the two runs and the number of occurrences.

      提示

      為求較佳的報告效果,負載測試和 Web 效能測試可使用一些屬性,以提供較豐富的報告。For better reports several properties are available in load tests and web performance tests that enable richer reports. 頁面要求有兩個屬性會呈現在報告中:目標和報告名稱。The page request has two properties that are presented in the reports: Goal and Reporting Name. 針對目標報告的是頁面回應時間,另外報告中會使用報告名稱而非 URL。Page response times will be reported against goal, and the reporting name will be used instead of the URL in the reports. 在負載測試回合設定的 [管理計數器集合] 下方,[電腦標記] 屬性會以報告電腦名稱表示。In a load test Run Settings, under Manage Counter Sets, the Computer Tags property is presented in the report machine names. 此屬性很適合在報告中用來描述特定電腦的角色。This is very useful to describe the role of a particular machine in the report.

若要使用 Excel 產生負載測試趨勢報告To generate load test trend reports using Excel

  1. 在產生報告前,您必須先執行負載測試。Before you generate a report, you must run a load test.

  2. 有兩種方式可以建立 Excel 負載測試報告:You can create Excel load test reports in two ways:

    • 完成負載測試後,在 [負載測試結果] 頁面中,選擇工具列的 [建立 Excel 報表] 按鈕。After you complete a load test, in the Load Test Results page, choose the Create Excel Report button in the toolbar.

      注意

      如果 [ Web 效能測試結果檢視器] 工具列中的 [建立 excel 報表] 按鈕已停用,您可能需要在啟用 Microsoft Excel 前一次執行。If the Create Excel Report button is disabled in the Web Performance Test Results Viewer toolbar, you may need to run Microsoft Excel one time before it is enabled. 安裝 Visual Studio Enterprise 時,會將 Visual Studio Enterprise 負載測試增益集複製到您的電腦以供 Microsoft Excel 使用,但這個增益集的安裝程序要到執行 Microsoft Excel 後才算完成。When Visual Studio Enterprise is installed, the Visual Studio Enterprise load test add-in is copied to your computer for Microsoft Excel; however, Microsoft Excel must be run to complete the installation process for the add-in.

      Microsoft Excel 隨即開啟 [產生負載測試報告精靈]。Microsoft Excel opens with the Generate a Load Test Report Wizard.

    OROR

    1. 開啟 Microsoft Excel,選取 [Office] 功能區中的 [負載測試] 索引標籤,然後選擇 [負載測試報告]。Open Microsoft Excel, select the Load Test tab in the Office ribbon and then choose Load Test Report.

      [產生負載測試報告精靈] 隨即出現。The Generate a Load Test Report Wizard appears.

    2. 在 [選取包含負載測試的資料庫] 頁面的 [伺服器名稱] 下,鍵入包含負載測試結果的伺服器名稱。In the Select database which contains load tests page, under Server name, type the name of the server containing the load test results.

    3. 在 [資料庫名稱] 下拉式清單中,選取包含負載測試結果的資料庫。In the Database name drop-down list, select the database containing the load test results.

  3. 在 [您要如何產生報告?] 頁面中確認已選取 [建立報告],然後選擇 [下一步]。In the How do you want to generate your report page, verify that Create a report is selected and choose Next.

  4. 在 [您要產生哪一種報告?] 頁面中確認已選取 [趨勢],然後選擇 [下一步]。In the What type of report do you want to generate page, verify that Trend is selected and choose Next.

  5. 在 [輸入負載測試報告詳細資料] 頁面的 [報告名稱] 中,鍵入報告的名稱。In the Enter load test report details page, type a name for your report in Report Name.

  6. 選取要產生報告的負載測試,然後選擇 [下一步]。Select the load test you want to generate the report for and choose Next.

  7. 在 [選取報告的回合] 頁面的 [選取一或多個要新增報告的回合] 下方,選取您要在報告中比較的負載測試結果,然後選擇 [下一步]。In the Select the runs for your report page, under Select one or more runs to add to the report, select the load test results that you want to compare in the report and choose Next.

  8. 在 [選取報告的計數器] 頁面的 [選取一或多個要新增報告的計數器] 下方,有一個可展開的計數器清單,可以用來自訂您的報告。In the Select the counters for your report page, under Select one or more counters to add to the report, an expandable list of counters is available to customize your report. 選取您要比較以進行趨勢分析的計數器,然後選擇 [完成]。Select the counters that you want to compare for trend analysis and choose Finish.

  9. 隨即產生報告,其中的目錄可連結至報告中產生的各個 Excel 活頁簿索引標籤。The report is generated with a table of contents that has links to the various Excel workbook tabs generated in the report. 這些連結是以針對趨勢報告所選取的計數器為依據。The links are based on the counters selected for the trend report. 例如,如果您選取步驟 7 中的預設計數器,則報告會根據步驟 7 列出的每個計數器,在不同的 Excel 索引標籤中呈現資料。For example, if you left the default counters selected in step 7, then the report will generate data which is presented in separate tabs in Excel for each counter listed in step 7. 針對每個計數器所產生的資料,會以趨勢樣式圖表呈現。The data that is generated for each counter is presented in trend-style graphs.

    提示

    為求較佳的報告效果,負載測試和 Web 效能測試可使用一些屬性,以提供較豐富的報告。For better reports several properties are available in load tests and web performance tests that enable richer reports. 頁面要求有兩個屬性會呈現在報告中:目標和報告名稱。The page request has two properties that are presented in the reports: Goal and Reporting Name. 針對目標報告的是頁面回應時間,另外報告中會使用報告名稱而非 URL。Page response times will be reported against goal, and the reporting name will be used instead of the URL in the reports. 在負載測試回合設定的 [管理計數器集合] 下方,[電腦標記] 屬性會以報告電腦名稱表示。In a load test Run Settings, under Manage Counter Sets, the Computer Tags property is presented in the report machine names. 此屬性很適合在報告中用來描述特定電腦的角色。This is very useful to describe the role of a particular machine in the report.

.NET 安全性.NET security

負載測試結果和報告都含有潛在的敏感性資訊,可能會被用來對您的電腦或網路進行攻擊。Load test results and reports contain potentially sensitive information that might be used to build an attack against your computer or your network. 因為負載測試結果和報告都含有電腦名稱和連接字串,Load test results and reports contain computer names and connection strings. 所以當您與其他人共用負載測試報告時,請務必了解這點。You should be aware of this when you share load test reports with other people.

另請參閱See also