Skip to content

Commit

Permalink
chore: Define expected query durations to GQL performance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Feb 14, 2024
1 parent fae7727 commit c14ce92
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 14 deletions.
14 changes: 10 additions & 4 deletions k6/performance-tests/graphql/DataCubeComponents.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { check, fail } from "k6";
import { check } from "k6";
import exec from "k6/execution";
import http from "k6/http";

Expand All @@ -18,9 +18,15 @@ const query = `query DataCubeComponents(

const metadataByCubeIri = {
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9":
{},
"https://environment.ld.admin.ch/foen/nfi/nfi_C-20/cube/2023-3": {},
"https://energy.ld.admin.ch/elcom/electricityprice": {},
{
expectedQueryDuration: 750,
},
"https://environment.ld.admin.ch/foen/nfi/nfi_C-20/cube/2023-3": {
expectedQueryDuration: 2000,
},
"https://energy.ld.admin.ch/elcom/electricityprice": {
expectedQueryDuration: 10000,
},
};

const env = __ENV.ENV;
Expand Down
14 changes: 10 additions & 4 deletions k6/performance-tests/graphql/DataCubeMetadata.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { check, fail } from "k6";
import { check } from "k6";
import exec from "k6/execution";
import http from "k6/http";

Expand All @@ -18,9 +18,15 @@ const query = `query DataCubeMetadata(

const metadataByCubeIri = {
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9":
{},
"https://environment.ld.admin.ch/foen/nfi/nfi_C-20/cube/2023-3": {},
"https://energy.ld.admin.ch/elcom/electricityprice": {},
{
expectedQueryDuration: 250,
},
"https://environment.ld.admin.ch/foen/nfi/nfi_C-20/cube/2023-3": {
expectedQueryDuration: 250,
},
"https://energy.ld.admin.ch/elcom/electricityprice": {
expectedQueryDuration: 250,
},
};

const env = __ENV.ENV;
Expand Down
5 changes: 4 additions & 1 deletion k6/performance-tests/graphql/DataCubeObservations.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { check, fail } from "k6";
import { check } from "k6";
import exec from "k6/execution";
import http from "k6/http";

Expand Down Expand Up @@ -29,6 +29,7 @@ const metadataByCubeIri = {
},
},
},
expectedQueryDuration: 500,
},
"https://environment.ld.admin.ch/foen/nfi/nfi_C-20/cube/2023-3": {
cubeFilter: {
Expand Down Expand Up @@ -58,6 +59,7 @@ const metadataByCubeIri = {
},
},
},
expectedQueryDuration: 1500,
},
"https://energy.ld.admin.ch/elcom/electricityprice": {
cubeFilter: {
Expand Down Expand Up @@ -87,6 +89,7 @@ const metadataByCubeIri = {
},
},
},
expectedQueryDuration: 4000,
},
};

Expand Down
14 changes: 10 additions & 4 deletions k6/performance-tests/graphql/DataCubePreview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { check, fail } from "k6";
import { check } from "k6";
import exec from "k6/execution";
import http from "k6/http";

Expand All @@ -18,9 +18,15 @@ const query = `query DataCubePreview(

const metadataByCubeIri = {
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9":
{},
"https://environment.ld.admin.ch/foen/nfi/nfi_C-20/cube/2023-3": {},
"https://energy.ld.admin.ch/elcom/electricityprice": {},
{
expectedQueryDuration: 1250,
},
"https://environment.ld.admin.ch/foen/nfi/nfi_C-20/cube/2023-3": {
expectedQueryDuration: 1250,
},
"https://energy.ld.admin.ch/elcom/electricityprice": {
expectedQueryDuration: 1250,
},
};

const env = __ENV.ENV;
Expand Down
5 changes: 4 additions & 1 deletion k6/performance-tests/graphql/PossibleFilters.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { check, fail } from "k6";
import { check } from "k6";
import exec from "k6/execution";
import http from "k6/http";

Expand Down Expand Up @@ -31,6 +31,7 @@ const metadataByCubeIri = {
value: "https://ld.admin.ch/canton/1",
},
},
expectedQueryDuration: 600,
},
"https://environment.ld.admin.ch/foen/nfi/nfi_C-20/cube/2023-3": {
iri: "https://environment.ld.admin.ch/foen/nfi/nfi_C-20/cube/2023-3",
Expand All @@ -57,6 +58,7 @@ const metadataByCubeIri = {
value: "https://environment.ld.admin.ch/foen/nfi/EvaluationType/1",
},
},
expectedQueryDuration: 1500,
},
"https://energy.ld.admin.ch/elcom/electricityprice": {
iri: "https://energy.ld.admin.ch/elcom/electricityprice",
Expand All @@ -80,6 +82,7 @@ const metadataByCubeIri = {
"https://energy.ld.admin.ch/elcom/electricityprice/product/standard",
},
},
expectedQueryDuration: 3500,
},
};

Expand Down

0 comments on commit c14ce92

Please sign in to comment.