Add benchmark scripts
This commit is contained in:
parent
814298c549
commit
c154ea3fc6
4 changed files with 88 additions and 0 deletions
23
tests/benchmarks/graphql-batched.js
Normal file
23
tests/benchmarks/graphql-batched.js
Normal 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',
|
||||
}
|
||||
})
|
||||
}
|
15
tests/benchmarks/graphql.js
Normal file
15
tests/benchmarks/graphql.js
Normal 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',
|
||||
}
|
||||
})
|
||||
}
|
37
tests/benchmarks/rest-serial.js
Normal file
37
tests/benchmarks/rest-serial.js
Normal 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
13
tests/benchmarks/rest.js
Normal 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',
|
||||
}
|
||||
})
|
||||
}
|
Loading…
Reference in a new issue