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": {
// Includes only one of the fields `responseTime`, `instances`, `imbalanceRps`, `protocolCodesAbsolute`, `protocolCodesRelative`, `networkCodesAbsolute`, `networkCodesRelative`
"responseTime": {
"quantile": "string"
},
"instances": {
"agg": "string"
},
"imbalanceRps": "object",
"protocolCodesAbsolute": {
"codesPatterns": [
"string"
]
},
"protocolCodesRelative": {
"codesPatterns": [
"string"
]
},
"networkCodesAbsolute": {
"codesPatterns": [
"string"
]
},
"networkCodesRelative": {
"codesPatterns": [
"string"
]
}
// end of the list of possible fields
},
"threshold": {
"value": "string",
"comparison": "string"
}
}
}
|
Field |
Description |
|
folderId |
string Required field. ID of the folder containing tests. |
|
testFilter |
string Required field. Test filter selector to calculate KPI values for. |
|
testCase |
string Test case to calculate KPI values for. If not specified, KPI values will be calculated for 'overall' case. |
|
kpi |
Required field. KPI to be calculated. |
Kpi
KPI (Key Performance Indicator) represents some integral indicator measured during test.
|
Field |
Description |
|
selector |
Kind of KPI. |
|
threshold |
A condition that should be specified. |
KpiSelector
KPI selector.
|
Field |
Description |
|
responseTime |
Response time cummulative quantile (percentile). Includes only one of the fields |
|
instances |
A number of instances throughout the test. Includes only one of the fields |
|
imbalanceRps |
object An RPS at the moment the test has been auto-stopped. Includes only one of the fields |
|
protocolCodesAbsolute |
A total number of requests completed with certain protocol (HTTP, GRPC, etc.) codes. Includes only one of the fields |
|
protocolCodesRelative |
A percentage of requests completed with certain protocol (HTTP, GRPC, etc.) codes. Includes only one of the fields |
|
networkCodesAbsolute |
A total number of requests completed with certain network codes. Includes only one of the fields |
|
networkCodesRelative |
A percentage of requests completed with certain network codes. Includes only one of the fields |
ResponseTime
Response time.
|
Field |
Description |
|
quantile |
enum (QuantileType) Cummulative quantile (percentile).
|
Instances
Aggregated number of instances.
|
Field |
Description |
|
agg |
enum (Aggregation) Aggregation function.
|
ProtocolCodesAbsolute
|
Field |
Description |
|
codesPatterns[] |
string Protocol (HTTP, GRPC) code patterns to match. All successful HTTP responses: ['2xx', '3xx']. |
ProtocolCodesRelative
|
Field |
Description |
|
codesPatterns[] |
string Protocol (HTTP, GRPC) code patterns to match. All successful HTTP responses: ['2xx', '3xx']. |
NetworkCodesAbsolute
|
Field |
Description |
|
codesPatterns[] |
string Network code patterns to match. All successful network responses: ['0']. |
NetworkCodesRelative
|
Field |
Description |
|
codesPatterns[] |
string Network code patterns to match. All successful network responses: ['0']. |
KpiThreshold
KPI threshold represents a condition that an actual value of test's KPI should satisfy.
|
Field |
Description |
|
value |
string Value for comparison with an actual KPI value. |
|
comparison |
enum (Comparison) Comparison operator for comparing actual with the threshold value. Rule: actual (</<=/>/>=) reference
|
Response
HTTP Code: 200 - OK
{
"folderId": "string",
"values": [
{
"testId": "string",
"value": "string",
"isOk": "boolean"
}
]
}
|
Field |
Description |
|
folderId |
string ID of the folder. |
|
values[] |
Actual KPI values. |
KpiValue
An actual value of test's KPI.
|
Field |
Description |
|
testId |
string ID of a test. |
|
value |
string Value of KPI. |
|
isOk |
boolean A flag indicating whether the value satisfies KPI threshold condition. |