Skip to content

Commit acc6715

Browse files
committed
feat(endpoints): update prod-uncached endpoint
1 parent fd7562e commit acc6715

File tree

16 files changed

+68
-74
lines changed

16 files changed

+68
-74
lines changed

.github/workflows/performance-tests-pr.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: GraphQL performance tests (PR)
55
on: [deployment_status]
66

77
env:
8-
SUMMARY: ''
8+
SUMMARY: ""
99

1010
jobs:
1111
run_tests:
@@ -17,13 +17,13 @@ jobs:
1717
uses: actions/checkout@v4
1818
- name: Send an HTTP request to start up the server
1919
run: |
20-
curl -s '${{ github.event.deployment_status.target_url }}/api/graphql' -X 'POST' -H 'Content-Type: application/json' -d '{"operationName":"DataCubeObservations","variables":{"locale":"en","sourceType":"sparql","sourceUrl":"https://lindas.admin.ch/query","cubeFilter":{"iri":"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9","filters":{"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/Kanton":{"type":"single","value":"https://ld.admin.ch/canton/1"}}}},"query":"query DataCubeObservations($sourceType: String!, $sourceUrl: DataSourceUrl!, $locale: String!, $cubeFilter: DataCubeObservationFilter!) { dataCubeObservations(sourceType: $sourceType, sourceUrl: $sourceUrl, locale: $locale, cubeFilter: $cubeFilter) }"}' > /dev/null
20+
curl -s '${{ github.event.deployment_status.target_url }}/api/graphql' -X 'POST' -H 'Content-Type: application/json' -d '{"operationName":"DataCubeObservations","variables":{"locale":"en","sourceType":"sparql","sourceUrl":"https://lindas.cz-aws.net/query","cubeFilter":{"iri":"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9","filters":{"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/Kanton":{"type":"single","value":"https://ld.admin.ch/canton/1"}}}},"query":"query DataCubeObservations($sourceType: String!, $sourceUrl: DataSourceUrl!, $locale: String!, $cubeFilter: DataCubeObservationFilter!) { dataCubeObservations(sourceType: $sourceType, sourceUrl: $sourceUrl, locale: $locale, cubeFilter: $cubeFilter) }"}' > /dev/null
2121
- name: Download, unzip and install k6 binary
2222
run: |
23-
wget https://github.com/grafana/k6/releases/download/v0.49.0/k6-v0.49.0-linux-amd64.tar.gz
24-
tar -xzf k6-v0.49.0-linux-amd64.tar.gz
25-
sudo cp k6-v0.49.0-linux-amd64/k6 /usr/local/bin/k6
26-
export PATH=$PATH:/usr/local/bin
23+
wget https://github.com/grafana/k6/releases/download/v0.49.0/k6-v0.49.0-linux-amd64.tar.gz
24+
tar -xzf k6-v0.49.0-linux-amd64.tar.gz
25+
sudo cp k6-v0.49.0-linux-amd64/k6 /usr/local/bin/k6
26+
export PATH=$PATH:/usr/local/bin
2727
- name: Run k6 test (iteration 1)
2828
run: echo "SUMMARY=${{ env.SUMMARY }}$(k6 run --tag testid=DataCubeComponents --env ENV=PR --env ENDPOINT=${{ github.event.deployment_status.target_url }}/api/graphql --env CUBE_IRI=https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9 --env CUBE_LABEL=Photovoltaikanlagen/9 --env CHECK_TIMING=true --env WORKSPACE=${{ github.workspace }} --quiet - <k6/performance-tests/graphql/DataCubeComponents.js)" >> $GITHUB_ENV
2929
- name: Run k6 test (iteration 2)

app/components/debug-search.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export const DebugSearch = () => {
226226
value={sourceUrl}
227227
>
228228
<MenuItem value="https://lindas.int.cz-aws.net/query">int</MenuItem>
229-
<MenuItem value="https://lindas.admin.ch/query">prod</MenuItem>
229+
<MenuItem value="https://lindas.cz-aws.net/query">prod</MenuItem>
230230
</Select>
231231
<TextField
232232
defaultValue=""

app/components/graphql-joinby.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ const combinations: {
153153
{
154154
id: 4,
155155
name: "NFI Change + Photovoltaik",
156-
sourceUrl: "https://lindas.admin.ch/query",
156+
sourceUrl: "https://lindas.cz-aws.net/query",
157157
cubes: [
158158
{
159159
iri: "https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9",

app/components/graphql-search.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,23 @@ const options = [
3434
id: "0",
3535
cubeIri: "https://environment.ld.admin.ch/foen/nfi/nfi_C-1029/cube/2023-1",
3636
sourceType: "sparql",
37-
sourceUrl: "https://lindas.admin.ch/query",
37+
sourceUrl: "https://lindas.cz-aws.net/query",
3838
label: "NFI Topics by stage of stand development",
3939
},
4040
{
4141
id: "1",
4242
cubeIri:
4343
"https://energy.ld.admin.ch/sfoe/bfe_ogd84_einmalverguetung_fuer_photovoltaikanlagen/9",
4444
sourceType: "sparql",
45-
sourceUrl: "https://lindas.admin.ch/query",
45+
sourceUrl: "https://lindas.cz-aws.net/query",
4646
label: "Einmalvergütung für Photovoltaikanlagen",
4747
},
4848
{
4949
id: "2",
5050
cubeIri:
5151
'"https://energy.ld.admin.ch/sfoe/bfe_ogd18_gebaeudeprogramm_auszahlungen/8',
5252
sourceType: "sparql",
53-
sourceUrl: "https://lindas.admin.ch/query",
53+
sourceUrl: "https://lindas.cz-aws.net/query",
5454
label:
5555
"Gebäudeprogramm - Auszahlungen nach Massnahmenbereich und Berichtsjahr",
5656
},

app/domain/data-source/constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import keyBy from "lodash/keyBy";
22

33
import { WHITELISTED_DATA_SOURCES } from "../env";
44

5-
export const LEGACY_PROD_DATA_SOURCE_URL = "https://lindas.admin.ch/query";
5+
export const LEGACY_PROD_DATA_SOURCE_URL = "https://lindas.cz-aws.net/query";
66

77
export const PROD_DATA_SOURCE_URL = "https://lindas-cached.cz-aws.net/query";
88

@@ -15,9 +15,9 @@ export const SOURCE_OPTIONS = [
1515
supportsCachingPerCubeIri: true,
1616
},
1717
{
18-
value: "sparql+https://lindas.admin.ch/query",
18+
value: "sparql+https://lindas.cz-aws.net/query",
1919
label: "Prod-uncached",
20-
url: "https://lindas.admin.ch/query",
20+
url: "https://lindas.cz-aws.net/query",
2121
isTrusted: true,
2222
supportsCachingPerCubeIri: true,
2323
},

app/graphql/hooks.mock.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const useDataCubesComponentsQueryVariables: Record<
66
> = {
77
oneCube: {
88
sourceType: "sparql",
9-
sourceUrl: "https://lindas.admin.ch/query",
9+
sourceUrl: "https://lindas.cz-aws.net/query",
1010
locale: "de",
1111
cubeFilters: [
1212
{
@@ -33,7 +33,7 @@ export const useDataCubesComponentsQueryVariables: Record<
3333
},
3434
twoCubes: {
3535
sourceType: "sparql",
36-
sourceUrl: "https://lindas.admin.ch/query",
36+
sourceUrl: "https://lindas.cz-aws.net/query",
3737
locale: "de",
3838
cubeFilters: [
3939
{

app/scripts/cube.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ const main = async () => {
150150

151151
const sourceUrlArg = {
152152
argument: ["-l", "--sourceUrl"],
153-
defaultValue: "https://lindas.admin.ch/query",
153+
defaultValue: "https://lindas.cz-aws.net/query",
154154
help: "DataUrlType",
155155
};
156156

app/utils/router/use-route-state.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ vi.mock("next/router", () => {
1515
describe("use route state", () => {
1616
const prodSource = {
1717
type: "sparql" as const,
18-
url: "https://lindas.admin.ch/query",
18+
url: "https://lindas.cz-aws.net/query",
1919
};
2020

2121
const setup = ({ initialRouterQuery = {} } = {}) => {

k6/load-tests/graphql/components.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ fragment dimensionMetadata on Dimension {
5858
type
5959
__typename
6060
}
61-
61+
6262
... on TemporalDimension {
6363
timeUnit
6464
timeFormat
6565
__typename
6666
}
67-
67+
6868
... on NumericalMeasure {
6969
isCurrency
7070
currencyExponent
@@ -77,7 +77,7 @@ fragment dimensionMetadata on Dimension {
7777
const variables = {
7878
iri: "https://environment.ld.admin.ch/foen/ubd003701/2",
7979
sourceType: "sparql",
80-
sourceUrl: "https://lindas.admin.ch/query",
80+
sourceUrl: "https://lindas.cz-aws.net/query",
8181
locale: "en",
8282
componentIds: [
8383
"https://environment.ld.admin.ch/foen/ubd003701/beurteilung",
@@ -100,15 +100,14 @@ export const options = {
100100
ext: {
101101
loadimpact: {
102102
projectId: PROJECT_ID,
103-
name: `GraphQL - Components (${env.toUpperCase()}, GQL ${
104-
enableCache ? "cache" : "no-cache"
105-
})`,
103+
name: `GraphQL - Components (${env.toUpperCase()}, GQL ${enableCache ? "cache" : "no-cache"
104+
})`,
106105
distribution: DISTRIBUTION,
107106
},
108107
},
109108
};
110109

111-
export default function Components() {
110+
export default function Components () {
112111
http.post(getUrl(env), JSON.stringify({ query, variables }), {
113112
headers: getHeaders(enableCache),
114113
});

k6/load-tests/graphql/observations.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const query = `query DataCubeObservations(
3737
const variables = {
3838
iri: "https://culture.ld.admin.ch/sfa/StateAccounts_Office/4/",
3939
sourceType: "sparql",
40-
sourceUrl: "https://lindas.admin.ch/query",
40+
sourceUrl: "https://lindas.cz-aws.net/query",
4141
locale: "en",
4242
componentIds: [
4343
"http://www.w3.org/2006/time#Year",
@@ -67,15 +67,14 @@ export const options = {
6767
ext: {
6868
loadimpact: {
6969
projectId: PROJECT_ID,
70-
name: `GraphQL - Observations (${env.toUpperCase()}, GQL ${
71-
enableCache ? "cache" : "no-cache"
72-
})`,
70+
name: `GraphQL - Observations (${env.toUpperCase()}, GQL ${enableCache ? "cache" : "no-cache"
71+
})`,
7372
distribution: DISTRIBUTION,
7473
},
7574
},
7675
};
7776

78-
export default function Observations() {
77+
export default function Observations () {
7978
http.post(getUrl(env), JSON.stringify({ query, variables }), {
8079
headers: getHeaders(enableCache),
8180
});

0 commit comments

Comments
 (0)