简体   繁体   中英

Run SQL Queries from Visual Studio 2010 Test Suite when running Load Tests

I am newbie to Visual Studio 2010 test suite. I have created a load test to perform some stress testing on the wcf services where I am gradually increasing the number of users. These services perform some processing of the data and store the result in database. I am seeing that some of the data is not getting processed completely. I have written SQL queries to which I am executing manually in SQL Management Studio once every 5 minutes to see at what point the processing failing. I was wondering if there is a way to automate this process from visual studio to make it run these queries automatically once every 5 minutes or on some other condition and store the results instead of me running them manually in SQL Management studio.

Yes. A Visual Studio LoadTest can execute both WebPerformanceTests as well as traditional Unit Tests.

  1. Create a new Unit Test, set it up to perform the SQL Query that you need to do.
  2. Add a new Scenario to your LoadTest
  3. Add the Unit Test to your new Scenario
  4. Edit the Test Mix in your new scenario and select the "Test mix based on user pace" Test Mix Model.
  5. Set the Tests Per User Per Hour to 12 (every 5 minutes).
  6. Ensure that your new Scenario's Load Pattern is constant and the Constant User Count is 1.

您可以创建一个简单的控制台应用程序,该应用程序可以休眠然后调用查询,或者设置“计划任务”以每x分钟运行一次。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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