你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Test Run - List Test Runs Search
使用给定筛选器获取所有测试运行
GET https://{Endpoint}/testruns/sortAndFilter?api-version=2022-06-01-preview
GET https://{Endpoint}/testruns/sortAndFilter?orderBy={orderBy}&continuationToken={continuationToken}&search={search}&executionFrom={executionFrom}&executionTo={executionTo}&status={status}&maxPageSize={maxPageSize}&api-version=2022-06-01-preview&testId={testId}
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
Endpoint
|
path | True |
string uri |
用于对资源执行数据平面 API 操作的 URL。 |
api-version
|
query | True |
string |
API 版本 |
continuation
|
query |
string |
用于获取下一页响应的继续标记。 |
|
execution
|
query |
string date-time |
结束日期时间 (ISO 8601 文本格式) 测试运行执行时间筛选器范围。 |
|
execution
|
query |
string date-time |
start DateTime (ISO 8601 文本格式) 测试运行执行时间筛选器范围。 |
|
max
|
query |
integer int32 |
响应中的结果数。 |
|
order
|
query |
string |
按其中一个字段进行排序 - status、displayName、executedDateTime (字段 asc/desc) 格式。 例如:displayName asc。 |
|
search
|
query |
string |
基于可搜索字段筛选搜索 - description,executedUser。 |
|
status
|
query |
string |
以逗号分隔的测试运行状态列表,值可以是 - “ACCEPTED”、“NOTSTARTED”、“PROVISIONING”、“PROVISIONED”、“CONFIGURING”、“已配置”、“执行”、“EXECUTED”、“DEPROVISIONING”、“DEPROVISIONED”、“DEPROVISIONED”、“DONE”、“CANCELLED”、“FAILED”。 |
|
test
|
query |
string |
负载测试的唯一名称必须是有效的 URL 字符 ^[a-z0-9_-]*$。 Regex pattern: |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
请求的测试运行 |
|
Other Status Codes |
负载测试服务错误响应。 Headers x-ms-error-code: string |
示例
ListTestRunsSearch
Sample Request
GET https://{Endpoint}/testruns/sortAndFilter?orderBy=executedDateTime&continuationToken=continuation token&search=Performance_LoadTest_Run1&executionFrom=2021-12-05T16:43:48.805Z&executionTo=2021-12-05T16:43:48.805Z&status=DONE,EXECUTING&maxPageSize=30&api-version=2022-06-01-preview&testId=12345678-1234-1234-1234-123456789012
Sample Response
{
"value": [
{
"testRunId": "12316678-1234-1234-1234-122451189012",
"displayName": "Performance_LoadTest_Run1",
"testId": "12345678-1234-1234-1234-123456789012",
"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/microsoft.loadtestservice/sampleresourcetype/sampleresourcename",
"description": "sample description",
"status": "DONE",
"startDateTime": "2021-12-05T16:43:48.125Z",
"endDateTime": "2021-12-05T16:43:48.125Z",
"loadTestConfig": {
"engineInstances": 6,
"splitAllCSVs": true
},
"testResult": "Passed",
"passFailCriteria": {
"passFailMetrics": {
"fefd759d-7fe8-4f83-8b6d-aeebe0f491fe": {
"clientmetric": "response_time_ms",
"aggregate": "percentage",
"condition": ">",
"value": 10,
"action": "continue",
"actualValue": 10,
"result": "passed"
}
}
},
"testArtifacts": {
"inputArtifacts": {
"configUrl": {
"url": "https://dummyurl.com/configresource",
"fileId": "92345678-1234-1111-1234-123456789012",
"filename": "config.yaml",
"fileType": 2,
"expireTime": "2021-12-05T16:43:46.072Z",
"validationStatus": ""
},
"testScriptUrl": {
"url": "https://dummyurl.com/testscriptresource",
"fileId": "92345678-1234-1111-1234-123456789011",
"filename": "sample.jmx",
"fileType": 0,
"expireTime": "2021-12-05T16:43:46.072Z",
"validationStatus": "VALIDATION_SUCCESS"
},
"userPropUrl": {
"url": "https://dummyurl.com/userpropresource",
"fileId": "92345678-1234-1111-1234-123456789013",
"filename": "user.properties",
"fileType": 1,
"expireTime": "2021-12-05T16:43:46.072Z",
"validationStatus": ""
},
"inputArtifactsZipFileurl": {
"url": "https://dummyurl.com/inputartifactzipresource",
"fileId": "92345678-1234-1111-1234-123456789012",
"filename": "inputartifacts.zip",
"fileType": 2,
"expireTime": "2021-12-05T16:43:46.072Z",
"validationStatus": ""
},
"additionalUrls": []
},
"outputArtifacts": {
"resultUrl": {
"url": "https://dummyurl.com/dummyresourceresult",
"fileId": "92345678-1234-1111-1234-123456789012",
"filename": "sample.jmx",
"fileType": 0,
"expireTime": "2021-12-05T16:43:46.072Z",
"validationStatus": "VALIDATION_SUCCESS"
},
"logsUrl": {
"url": "https://dummyurl.com/logresource",
"fileId": "abb846a7-63af-4d63-bb3d-a7aa4caff55c",
"filename": "worker.log",
"fileType": 2,
"expireTime": "2022-05-16T09:14:46.0411793+00:00",
"validationStatus": ""
}
}
},
"executedDateTime": "2021-12-05T16:43:48.125Z",
"vusers": 4,
"testRunStatistics": {
"Total": {
"transaction": "Total",
"sampleCount": 18,
"errorCount": 19,
"errorPct": 17,
"meanResTime": 13,
"medianResTime": 10,
"maxResTime": 16,
"minResTime": 18,
"pct1ResTime": 27,
"pct2ResTime": 20,
"pct3ResTime": 3,
"throughput": 5,
"receivedKBytesPerSec": 13,
"sentKBytesPerSec": 4
}
},
"createdDateTime": "2021-12-05T16:43:46.072Z",
"createdBy": "user@contoso.com",
"lastModifiedDateTime": "2021-12-05T16:43:46.072Z",
"lastModifiedBy": "user@contoso.com",
"portalUrl": "https://portal.azure.com/dummyresource",
"secrets": {
"secret1": {
"value": "https://samplevault.vault.azure.net/secrets/samplesecret/f113f91fd4c44a368049849c164db827",
"type": "AKV_SECRET_URI"
}
},
"environmentVariables": {
"envvar1": "sampletext"
},
"duration": 18,
"subnetId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/samplerg/providers/Microsoft.Network/virtualNetworks/samplenetworkresource/subnets/AAAAA0A0A0"
}
],
"nextLink": "next link"
}
定义
名称 | 说明 |
---|---|
Error |
REST 请求出错。 |
Error |
错误对象的定义。 |
File |
文件类型的整数表示形式 (0 = JMX_FILE,1 = USER_PROPERTIES,2 = ADDITIONAL_ARTIFACTS) |
File |
FileUrl 模型。 |
Input |
测试的输入项目。 |
Load |
负载测试配置。 |
Output |
测试运行的输出项目。 |
Pass |
通过测试的失败条件。 |
Pass |
|
Secret |
|
Test |
|
Test |
负载测试运行模型 |
Test |
资源列表 |
Test |
测试运行统计信息。 |
Error
REST 请求出错。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
错误代码。 |
details |
Error[] |
其他详细信息和内部错误。 |
message |
string |
错误消息。 |
target |
string |
错误目标。 |
ErrorResponseBody
错误对象的定义。
名称 | 类型 | 说明 |
---|---|---|
error |
REST 请求出错。 |
FileType
文件类型的整数表示形式 (0 = JMX_FILE,1 = USER_PROPERTIES,2 = ADDITIONAL_ARTIFACTS)
名称 | 类型 | 说明 |
---|---|---|
0 |
Integer |
|
1 |
Integer |
|
2 |
Integer |
FileUrl
FileUrl 模型。
名称 | 类型 | 说明 |
---|---|---|
expireTime |
string |
文件的到期时间 |
fileId |
string |
文件唯一标识符。 |
fileType |
文件类型的整数表示形式 (0 = JMX_FILE,1 = USER_PROPERTIES,2 = ADDITIONAL_ARTIFACTS) |
|
filename |
string |
文件的名称。 |
url |
string |
文件 URL。 |
validationStatus |
string |
文件的验证状态 |
InputTestArtifacts
测试的输入项目。
名称 | 类型 | 说明 |
---|---|---|
additionalUrls |
File |
测试运行的输入项目文件 { name : url } 映射。 |
configUrl |
FileUrl 模型。 |
|
inputArtifactsZipFileurl |
FileUrl 模型。 |
|
testScriptUrl |
FileUrl 模型。 |
|
userPropUrl |
FileUrl 模型。 |
LoadTestConfig
负载测试配置。
名称 | 类型 | 说明 |
---|---|---|
engineInstances |
integer |
要执行负载测试的引擎实例数。 支持的值为 1-45。 创建新测试所必需的。 |
splitAllCSVs |
boolean |
是否应在所有引擎之间均匀拆分所有输入 CSV 文件。 |
OutputTestArtifacts
测试运行的输出项目。
名称 | 类型 | 说明 |
---|---|---|
logsUrl |
FileUrl 模型。 |
|
resultUrl |
FileUrl 模型。 |
PassFailCriteria
通过测试的失败条件。
名称 | 类型 | 说明 |
---|---|---|
passFailMetrics |
<string,
Pass |
ID 和传递失败指标的映射 { id : 传递失败指标 }。 |
PassFailMetric
名称 | 类型 | 说明 |
---|---|---|
action |
string |
满足阈值后,“停止”或“继续”。 默认值为“continue”。 |
actualValue |
number |
测试运行的客户端指标的实际值。 |
aggregate |
string |
要应用于客户端指标的聚合函数。 允许的函数 - “percentage” - 用于错误指标 ,'avg','p50','p90','p95','p99','min','max'- 对于response_time_ms和延迟指标,'avg'- 用于requests_per_sec,'count' - 请求。 |
clientmetric |
string |
应应用条件的客户端指标。 允许的值 -“response_time_ms”、“latency”、“error”、“requests”、“requests_per_sec”。 |
condition |
string |
比较运算符。 支持的类型“”> |
requestName |
string |
必须应用 Pass 失败条件的请求名称。 |
result |
string |
测试运行的结果。 可能的结果 -“passed”、“failed”、“undemined”。 |
value |
number |
要与客户端指标进行比较的值。 允许的值 - 'error : [0.0 , 100.0] unit- % ',response_time_ms和延迟 :任何整数值单位 - ms。 |
SecretMetadata
名称 | 类型 | 说明 |
---|---|---|
type |
string |
机密的类型。 例如 AKV_SECRET_URI/SECRET_VALUE |
value |
string |
机密的值,类型为 AKV_SECRET_URI 或 SECRET_VALUE |
TestArtifacts
名称 | 类型 | 说明 |
---|---|---|
inputArtifacts |
测试的输入项目。 |
|
outputArtifacts |
测试运行的输出项目。 |
TestRunModel
负载测试运行模型
名称 | 类型 | 说明 |
---|---|---|
createdBy |
string |
创建测试运行的用户。 |
createdDateTime |
string |
创建的 DateTime (测试运行) ISO 8601 文本格式。 |
description |
string |
测试运行说明。 |
displayName |
string |
测试运行的显示名称。 |
duration |
integer |
测试运行持续时间(以毫秒为单位)。 |
endDateTime |
string |
测试运行结束 DateTime (ISO 8601 文本格式) 。 |
environmentVariables |
object |
定义为一组名称、值>对的<环境变量。 |
executedDateTime |
string |
测试运行启动时间 |
lastModifiedBy |
string |
更新了测试运行的用户。 |
lastModifiedDateTime |
string |
上次更新的 DateTime (测试运行的 ISO 8601 文本格式) 。 |
loadTestConfig |
负载测试配置。 |
|
passFailCriteria |
通过测试的失败条件。 |
|
portalUrl |
string |
门户 URL。 |
resourceId |
string |
负载测试资源 ID。 |
secrets |
<string,
Secret |
机密可以存储在 Azure 密钥保管库或任何其他机密存储中。 如果机密存储在 Azure 密钥保管库中,则该值应为机密标识符,类型应AKV_SECRET_URI。 如果机密存储在其他位置,则应直接提供机密值,并且应SECRET_VALUE类型。 |
startDateTime |
string |
测试运行 start DateTime (ISO 8601 文本格式) 。 |
status |
string |
测试运行状态。 |
subnetId |
string |
负载测试实例应在其上运行的子网 ID。 |
testArtifacts | ||
testId |
string |
关联的测试 ID。 |
testResult |
string |
测试运行期间使用的通过/失败条件的测试结果。 可能的结果 -“已通过”、“失败”、“不适用”。 |
testRunId |
string |
作为标识符的唯一测试运行名称。 |
testRunStatistics |
<string,
Test |
测试运行统计信息 |
vusers |
integer |
已为其运行测试的虚拟用户数。 |
TestRunModelResourceList
资源列表
名称 | 类型 | 说明 |
---|---|---|
nextLink |
string |
如果出现分页结果,下一个资源列表的链接(如果适用) |
value |
资源列表 |
TestRunStatisticsModel
测试运行统计信息。
名称 | 类型 | 说明 |
---|---|---|
errorCount |
number |
错误计数。 |
errorPct |
number |
错误百分比。 |
maxResTime |
number |
最大响应时间。 |
meanResTime |
number |
平均响应时间。 |
medianResTime |
number |
中值响应时间。 |
minResTime |
number |
最短响应时间。 |
pct1ResTime |
number |
90 百分位响应时间。 |
pct2ResTime |
number |
95 百分位响应时间。 |
pct3ResTime |
number |
99 百分位响应时间。 |
receivedKBytesPerSec |
number |
收到的网络字节数。 |
sampleCount |
number |
采样器计数。 |
sentKBytesPerSec |
number |
已发送网络字节。 |
throughput |
number |
吞吐量。 |
transaction |
string |
事务名称。 |