简体   繁体   English

轻松自动化负载/性能测试 | Azure ASP.NET Web 应用程序

[英]Easily Automate Load/Performance tests | Azure ASP.NET Web App

Setting up automated unit-tests with Azure has been a breeze..使用 Azure 设置自动化单元测试轻而易举。

However, I'm running into some walls trying to setup some load/performance tests for my Web App.但是,我在尝试为我的 Web 应用程序设置一些负载/性能测试时遇到了一些障碍。

Could anyone provide a simple tutorial for setting up automated load/performance tests in Azure?谁能提供一个简单的教程来在 Azure 中设置自动负载/性能测试? To start I just want something very simple to automate.首先,我只想要一些非常简单的自动化。

I'm not sure if I should be using 1) Azure's Performance Tests, 2) Visual Studio's cloud-based load testing, 3) A Visual Studio Web Performance / Load Test Project (.csproj), 4) A build step in my Visual Studio Team Services build definition (this is how I'm currently automating unit tests), or 5) something else??我不确定我是否应该使用 1) Azure 的性能测试,2) Visual Studio 的基于云的负载测试,3) Visual Studio Web 性能/负载测试项目 (.csproj),4) 我的 Visual 中的构建步骤Studio Team Services 构建定义(这是我目前自动化单元测试的方式),或 5)其他什么??

Thanks!!谢谢!!

I have figured out a technique我想出了一个技巧

1) Record a Test Using Chrome, this can be done from the (dev tools) network tab, make sure that Preserve Log is checked. 1) 使用 Chrome 记录测试,这可以从(开发工具)网络选项卡完成,确保选中保留日志。 Now you can use the actual site and browser to record a UI test.现在您可以使用实际站点和浏览器来记录 UI 测试。

2) You can export the Test by Right Clicking on the list of network calls and clicking on 'Save as HAR with Content'. 2) 您可以通过右键单击网络调用列表并单击“另存为带有内容的 HAR”来导出测试。

3) In VSTS, I can then go to my Load Tests and create a new Load Test, and click New and then HTTP Archive Based Test and select the .HAR file you saved. 3) 在 VSTS 中,我可以转到我的负载测试并创建一个新的负载测试,然后单击新建,然后单击基于 HTTP 存档的测试并选择您保存的 .HAR 文件。

4) Now everything can be automated from VSTS and via a VSTS Build step, etc. 4)现在一切都可以从 VSTS 和通过 VSTS 构建步骤等自动化。

5) From VSTS you can also Export to Visual Studios, which will create the necessary C# files for creating a Test Project. 5) 您还可以从 VSTS 导出到 Visual Studios,这将创建创建测试项目所需的 C# 文件。

6) You can create a 'Load' test based on your performance test in Visual Studios. 6) 您可以根据 Visual Studios 中的性能测试创建“负载”测试。

Visual Studios is really becoming a one stop shop for everything awesome. Visual Studios 真的成为了所有很棒的东西的一站式商店。

There is a good article with detail steps to do cloud load test and you can create/start/stop test run through Rest API. 一篇很好的文章,其中包含进行云负载测试的详细步骤,您可以通过 Rest API 创建/启动/停止测试运行。

  1. Create a valid loadtest file.创建有效的负载测试文件。 You can use the load test file from an earlier run through Visual Studio for this.为此,您可以使用之前通过 Visual Studio 运行的负载测试文件。
  2. Create a location to upload the file(s).创建一个位置来上传文件。 This location is a drop folder on Azure Blob and is below referred to as "TestDrop".此位置是 Azure Blob 上的放置文件夹,以下称为“TestDrop”。
  3. Upload the loadtest file and any other files required for the run, this includes the webtest files, settings file, etc. to this location or "TestDrop".将 loadtest 文件和运行所需的任何其他文件(包括 webtest 文件、设置文件等)上传到此位置或“TestDrop”。
  4. Create a Test Run using the Testdrop from the previous step as all the files required for a run are now available at the drop location.使用上一步中的 Testdrop 创建测试运行,因为运行所需的所有文件现在都可在放置位置使用。
  5. Start the run.开始跑步。
  6. Once finished, download the results to your local machine.完成后,将结果下载到本地计算机。 This will be a gzip file.这将是一个 gzip 文件。 Uncompress it to get the results file.解压得到结果文件。
  7. Use Visual Studio to view the downloaded results.使用 Visual Studio 查看下载的结果。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM