Skip to main content

Create

Creates a regression dashboard in the specified folder.

import {
cloudApi,
decodeMessage,
serviceClients,
Session,
waitForOperation,
} from "@yandex-cloud/nodejs-sdk";

const Aggregation = cloudApi.loadtesting.api_report_kpi.Aggregation;
const Comparison = cloudApi.loadtesting.api_report_kpi.Comparison;
const CreateRegressionDashboardRequest =
cloudApi.loadtesting.api_regression_dashboard_service
.CreateRegressionDashboardRequest;
const Dashboard = cloudApi.loadtesting.api_regression_dashboard.Dashboard;
const QuantileType = cloudApi.loadtesting.api_common_quantiles.QuantileType;
const TitleWidget_TitleSize =
cloudApi.loadtesting.api_regression_widget.TitleWidget_TitleSize;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(
serviceClients.RegressionDashboardServiceClient
);

const operation = await client.create(
CreateRegressionDashboardRequest.fromPartial({
folderId: "folderId",
// name: "name",
// description: "description",
// content: {
// widgets: [{
// position: {
// x: 0,
// y: 0,
// width: 0,
// height: 0
// },
// chart: {
// id: "id",
// name: "name",
// description: "description",
// filterStr: "filterStr",
// testCase: "testCase",
// kpis: [{
// selector: {
// responseTime: {
// quantile: QuantileType.QUANTILE_TYPE_50
// },
// instances: {
// agg: Aggregation.AGGREGATION_MIN
// },
// imbalanceRps: {

// },
// protocolCodesAbsolute: {
// codesPatterns: ["codesPatterns"]
// },
// protocolCodesRelative: {
// codesPatterns: ["codesPatterns"]
// },
// networkCodesAbsolute: {
// codesPatterns: ["codesPatterns"]
// },
// networkCodesRelative: {
// codesPatterns: ["codesPatterns"]
// }
// },
// threshold: {
// value: 0,
// comparison: Comparison.COMPARISON_LT
// }
// }]
// },
// text: {
// text: "text"
// },
// title: {
// text: "text",
// size: TitleWidget_TitleSize.TITLE_SIZE_XS
// }
// }]
// }
})
);
const finishedOp = await waitForOperation(operation, session);

if (finishedOp.response) {
const result = decodeMessage<typeof regression.Dashboard>(
finishedOp.response
);
console.log(result);
}
})();

CreateRegressionDashboardRequest​

folderId : string​

ID of the folder to create a regression dashboard in.

name : string​

Name of the dashboard.

description : string​

Description of the dashboard.

content : regression.Dashboard.Content​

Content of the dashboard.

Content​

Content of regression dashboard.

widgets : Widget​

Widgets.

Widget​

Regression dashboard widget.

LayoutPosition​

Widget position.

x : int64​

X.

y : int64​

Y.

width : int64​

Width.

height : int64​

Height.

position : LayoutPosition​

Widget position.

One of widget​

  • chart : ChartWidget​

    Chart widget.

  • text : TextWidget​

    Text widget.

  • title : TitleWidget​

    Title widget.

LayoutPosition​

Widget position.

x : int64​

X.

y : int64​

Y.

width : int64​

Width.

height : int64​

Height.

ChartWidget​

Regression chart.

id : string​

ID of the chart.

name : string​

Name of the chart.

description : string​

Description of the chart.

filterStr : string​

Test filter selector to show KPI values for.

testCase : string​

Test case to show KPI values for.

kpis : report.Kpi​

KPIs to show.

TextWidget​

Text widget.

text : string​

Text string.

TitleWidget​

Title widget.

TitleSize​

Title size.

  • TITLE_SIZE_UNSPECIFIED

    Unspecified.

  • TITLE_SIZE_XS

    Extra small.

  • TITLE_SIZE_S

    Small.

  • TITLE_SIZE_M

    Medium.

  • TITLE_SIZE_L

    Large.

text : string​

Title string.

size : TitleSize​

Title size.

Kpi​

KPI (Key Performance Indicator) represents some integral indicator measured during test.

selector : KpiSelector​

Kind of KPI.

threshold : KpiThreshold​

A condition that should be specified.

KpiSelector​

KPI selector.

ResponseTime​

Response time.

quantile : common.QuantileType​

Cummulative quantile (percentile).

Instances​

Aggregated number of instances.

agg : Aggregation​

Aggregation function.

ImbalanceRps​

Imbalance RPS.

ProtocolCodesAbsolute​
codesPatterns : string​

Protocol (HTTP, GRPC) code patterns to match.

All successful HTTP responses: '2xx', '3xx'. All failed HTTP responses: ['0', '4xx', '5xx'][2].

ProtocolCodesRelative​
codesPatterns : string​

Protocol (HTTP, GRPC) code patterns to match.

All successful HTTP responses: '2xx', '3xx'. All failed HTTP responses: ['0', '4xx', '5xx'][4].

NetworkCodesAbsolute​
codesPatterns : string​

Network code patterns to match.

All successful network responses: '0'. All failed network responses: 'xx', 'xxx'.

NetworkCodesRelative​
codesPatterns : string​

Network code patterns to match.

All successful network responses: '0'. All failed network responses: 'xx', 'xxx'.

One of kind​

  • responseTime : ResponseTime​

    Response time cummulative quantile (percentile).

  • instances : Instances​

    A number of instances throughout the test.

  • imbalanceRps : ImbalanceRps​

    An RPS at the moment the test has been auto-stopped.

  • protocolCodesAbsolute : ProtocolCodesAbsolute​

    A total number of requests completed with certain protocol (HTTP, GRPC, etc.) codes.

  • protocolCodesRelative : ProtocolCodesRelative​

    A percentage of requests completed with certain protocol (HTTP, GRPC, etc.) codes.

  • networkCodesAbsolute : NetworkCodesAbsolute​

    A total number of requests completed with certain network codes.

  • networkCodesRelative : NetworkCodesRelative​

    A percentage of requests completed with certain network codes.

KpiThreshold​

KPI threshold represents a condition that an actual value of test's KPI should satisfy.

value : double​

Value for comparison with an actual KPI value.

comparison : Comparison​

Comparison operator for comparing actual with the threshold value.

Rule: actual (</<=/>/>=) reference

ResponseTime​

Response time.

quantile : common.QuantileType​

Cummulative quantile (percentile).

Instances​

Aggregated number of instances.

agg : Aggregation​

Aggregation function.

ImbalanceRps​

Imbalance RPS.

ProtocolCodesAbsolute​

codesPatterns : string​

Protocol (HTTP, GRPC) code patterns to match.

All successful HTTP responses: '2xx', '3xx'. All failed HTTP responses: ['0', '4xx', '5xx'][10].

ProtocolCodesRelative​

codesPatterns : string​

Protocol (HTTP, GRPC) code patterns to match.

All successful HTTP responses: '2xx', '3xx'. All failed HTTP responses: ['0', '4xx', '5xx'][12].

NetworkCodesAbsolute​

codesPatterns : string​

Network code patterns to match.

All successful network responses: '0'. All failed network responses: 'xx', 'xxx'.

NetworkCodesRelative​

codesPatterns : string​

Network code patterns to match.

All successful network responses: '0'. All failed network responses: 'xx', 'xxx'.

Operation​

An Operation resource. For more information, see Operation.

id : string​

ID of the operation.

description : string​

Description of the operation. 0-256 characters long.

createdAt : google.protobuf.Timestamp​

Creation timestamp.

createdBy : string​

ID of the user or service account who initiated the operation.

modifiedAt : google.protobuf.Timestamp​

The time when the Operation resource was last modified.

done : bool​

If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.

metadata : google.protobuf.Any​

Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any.

One of result​

The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true, exactly one of error or response is set.

  • error : google.rpc.Status​

    The error result of the operation in case of failure or cancellation.

  • response : google.protobuf.Any​
    The normal response of the operation in case of success.

    If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is the standard Create/Update, the response should be the target resource of the operation. Any method that returns a long-running operation should document the response type, if any.


[2]: #protocolcodesrelative'0', '4xx', '5xx'

[4]: #protocolcodesrelative'0', '4xx', '5xx'

[10]: #protocolcodesrelative'0', '4xx', '5xx'

[12]: #protocolcodesrelative'0', '4xx', '5xx'