1
0
Fork 0
mirror of synced 2024-10-02 02:07:04 +13:00

Add benchmark scripts

This commit is contained in:
Jake Barnby 2022-07-14 13:47:32 +12:00
parent 814298c549
commit c154ea3fc6
4 changed files with 88 additions and 0 deletions

View file

@ -0,0 +1,23 @@
import http from 'k6/http';
export const options = {
vus: 20,
duration: '60s',
};
export default function () {
http.post('http://localhost/v1/graphql', JSON.stringify([{
query: 'query { localeGetCountries { total countries { code } } }',
}, {
query: 'query { localeGetContinents { total continents { code } } }',
}, {
query: 'query { localeGetCountriesEU { total continents { code } } }',
}, {
query: 'query { localeGetCountriesPhones { total continents { countryName } } }',
}, {
query: 'query { localeGetLanguages { total languages { name } } }',
}]), {
headers: {
'Content-Type': 'application/json',
'X-Appwrite-Project': 'test',
}
})
}

View file

@ -0,0 +1,15 @@
import http from 'k6/http';
export const options = {
vus: 20,
duration: '60s',
};
export default function () {
http.post('http://localhost/v1/graphql', JSON.stringify({
query: 'query { localeGetCountries { total countries { code name } } }',
}), {
headers: {
'Content-Type': 'application/json',
'X-Appwrite-Project': 'test',
}
})
}

View file

@ -0,0 +1,37 @@
import http from 'k6/http';
export const options = {
vus: 20,
duration: '60s',
};
export default function () {
http.get('http://localhost/v1/locale/countries', {
headers: {
'Content-Type': 'application/json',
'X-Appwrite-Project': 'test',
}
})
http.get('http://localhost/v1/locale/continents', {
headers: {
'Content-Type': 'application/json',
'X-Appwrite-Project': 'test',
}
})
http.get('http://localhost/v1/locale/countries/eu', {
headers: {
'Content-Type': 'application/json',
'X-Appwrite-Project': 'test',
}
})
http.get('http://localhost/v1/locale/countries/phones', {
headers: {
'Content-Type': 'application/json',
'X-Appwrite-Project': 'test',
}
})
http.get('http://localhost/v1/locale/languages', {
headers: {
'Content-Type': 'application/json',
'X-Appwrite-Project': 'test',
}
})
}

13
tests/benchmarks/rest.js Normal file
View file

@ -0,0 +1,13 @@
import http from 'k6/http';
export const options = {
vus: 20,
duration: '60s',
};
export default function () {
http.get('http://localhost/v1/locale/countries', {
headers: {
'Content-Type': 'application/json',
'X-Appwrite-Project': 'test',
}
})
}