Load Testing API, REST: Report.calculateKpiValues
Returns a list of KPI values for tests matching the specified filter.
HTTP request
POST https://loadtesting.api.cloud.yandex.net/loadtesting/api/v1/reports/calculateKpiValues
Body parameters
{
"folderId": "string",
"testFilter": "string",
"testCase": "string",
"kpi": {
"selector": {
// `kpi.selector` includes only one of the fields `responseTime`, `instances`, `imbalanceRps`, `protocolCodesAbsolute`, `protocolCodesRelative`, `networkCodesAbsolute`, `networkCodesRelative`
"responseTime": {
"quantile": "string"
},
"instances": {
"agg": "string"
},
"imbalanceRps": {},
"protocolCodesAbsolute": {
"codesPatterns": [
"string"
]
},
"protocolCodesRelative": {
"codesPatterns": [
"string"
]
},
"networkCodesAbsolute": {
"codesPatterns": [
"string"
]
},
"networkCodesRelative": {
"codesPatterns": [
"string"
]
},
// end of the list of possible fields`kpi.selector`
},
"threshold": {
"value": "number",
"comparison": "string"
}
}
}
Field | Description |
---|---|
folderId | string Required. ID of the folder containing tests. The maximum string length in characters is 50. |
testFilter | string Required. Test filter selector to calculate KPI values for. The maximum string length in characters is 1000. |
testCase | string Test case to calculate KPI values for. If not specified, KPI values will be calculated for 'overall' case. The maximum string length in characters is 100. |
kpi | object Required. KPI to be calculated. KPI (Key Performance Indicator) represents some integral indicator measured during test. |
kpi. selector |
object Kind of KPI. KPI selector. |
kpi. selector. responseTime |
object Response time cummulative quantile (percentile). kpi.selector includes only one of the fields responseTime , instances , imbalanceRps , protocolCodesAbsolute , protocolCodesRelative , networkCodesAbsolute , networkCodesRelative |
kpi. selector. responseTime. quantile |
string Cummulative quantile (percentile). Quantiles (percentiles).
|
kpi. selector. instances |
object A number of instances throughout the test. kpi.selector includes only one of the fields responseTime , instances , imbalanceRps , protocolCodesAbsolute , protocolCodesRelative , networkCodesAbsolute , networkCodesRelative |
kpi. selector. instances. agg |
string Aggregation function. Aggregation function.
|
kpi. selector. imbalanceRps |
object An RPS at the moment the test has been auto-stopped. kpi.selector includes only one of the fields responseTime , instances , imbalanceRps , protocolCodesAbsolute , protocolCodesRelative , networkCodesAbsolute , networkCodesRelative |
kpi. selector. protocolCodesAbsolute |
object A total number of requests completed with certain protocol (HTTP, GRPC, etc.) codes. kpi.selector includes only one of the fields responseTime , instances , imbalanceRps , protocolCodesAbsolute , protocolCodesRelative , networkCodesAbsolute , networkCodesRelative |
kpi. selector. protocolCodesAbsolute. codesPatterns[] |
string Protocol (HTTP, GRPC) code patterns to match. All successful HTTP responses: ['2xx', '3xx']. All failed HTTP responses: ['0', '4xx', '5xx']. |
kpi. selector. protocolCodesRelative |
object A percentage of requests completed with certain protocol (HTTP, GRPC, etc.) codes. kpi.selector includes only one of the fields responseTime , instances , imbalanceRps , protocolCodesAbsolute , protocolCodesRelative , networkCodesAbsolute , networkCodesRelative |
kpi. selector. protocolCodesRelative. codesPatterns[] |
string Protocol (HTTP, GRPC) code patterns to match. All successful HTTP responses: ['2xx', '3xx']. All failed HTTP responses: ['0', '4xx', '5xx']. |
kpi. selector. networkCodesAbsolute |
object A total number of requests completed with certain network codes. kpi.selector includes only one of the fields responseTime , instances , imbalanceRps , protocolCodesAbsolute , protocolCodesRelative , networkCodesAbsolute , networkCodesRelative |
kpi. selector. networkCodesAbsolute. codesPatterns[] |
string Network code patterns to match. All successful network responses: ['0']. All failed network responses: ['xx', 'xxx']. |
kpi. selector. networkCodesRelative |
object A percentage of requests completed with certain network codes. kpi.selector includes only one of the fields responseTime , instances , imbalanceRps , protocolCodesAbsolute , protocolCodesRelative , networkCodesAbsolute , networkCodesRelative |
kpi. selector. networkCodesRelative. codesPatterns[] |
string Network code patterns to match. All successful network responses: ['0']. All failed network responses: ['xx', 'xxx']. |
kpi. threshold |
object A condition that should be specified. KPI threshold represents a condition that an actual value of test's KPI should satisfy. |
kpi. threshold. value |
number (double) Value for comparison with an actual KPI value. |
kpi. threshold. comparison |
string Comparison operator for comparing actual with the threshold value. Rule: actual (</<=/>/>=) reference Comparison operator.
|
Response
HTTP Code: 200 - OK
{
"folderId": "string",
"values": [
{
"testId": "string",
"value": "number",
"isOk": true
}
]
}
Field | Description |
---|---|
folderId | string ID of the folder. |
values[] | object Actual KPI values. |
values[]. testId |
string ID of a test. |
values[]. value |
number (double) Value of KPI. |
values[]. isOk |
boolean (boolean) A flag indicating whether the value satisfies KPI threshold condition. |