【发布时间】:2017-01-15 16:36:40
【问题描述】:
我的自定义WebTest中有以下方法:
private WebTestRequest CreateRequest(CommandInput command)
{
WebTestRequest request = new WebTestRequest(URL);
request.ReportingName = command.CommandName;
request.Method = command.HttpMethod;
// ...
return request;
}
在我的GetRequestEnumerator 上,我正在调用这样的方法:
public override IEnumerable<WebTestRequest> GetRequestEnumerator()
{
return new CommandInput[]
{
new CommandInput() { CommandName = "configuration", HttpMethod = "POST" },
new CommandInput() { CommandName = "login", HttpMethod = "POST" },
new CommandInput() { CommandName = "quick_view", HttpMethod = "GET" },
new CommandInput() { CommandName = "esign_document", HttpMethod = "POST" }
}.Select(CreateRequest).GetEnumerator();
}
注意:原代码比这个复杂,但无关。
在我的本地机器上运行负载测试时,这工作正常:
您可以看到每个请求都由ReportingName 属性的值标识
但是,如果我在 Visual Studio Online 服务上运行负载测试,请求将按 URL 分组,而不是 ReportingName 上的值:
请求被分组为 command {GET} 和 command {POST},因为我的测试用例 (https://test.xxxx.com/api/command) 上的每个请求的 URL 都是相同的,只是其中一些请求的 HTTP 方法不同。
我在互联网上搜索了几个小时,只在 MSDN 上找到了这个关于它的开放线程:
Reporting Name does not show up in Page Results of Online Load Test
发生了什么?
【问题讨论】:
-
我可以得到与您相同的行为,并已在 MS Connect 上提交了有关此问题的反馈:connect.microsoft.com/VisualStudio/feedback/details/3102026
-
@Eddie-MSFT 很高兴听到这不是我的东西。感谢提交。
标签: c# visual-studio azure-devops performance-testing