Commit e2dc3fc1 authored by Grant Young's avatar Grant Young

Update search tests with configurable data

Update docs to match
parent c53b69fa
......@@ -16,7 +16,7 @@ require 'tmpdir'
k6_dir = Pathname.new(File.expand_path('../k6', __dir__)).relative_path_from(Dir.pwd)
gpt_version = '1.1.2'
gpt_version = '1.2'
puts Rainbow("GitLab Performance Tool (GPT) v#{gpt_version} - Performance test runner for GitLab environments based on k6").color(230, 83, 40)
opts = Optimist.options do
......
......@@ -61,57 +61,77 @@ As an example, the following is one of our Environment Config Files, [`10k.json`
{
"name": "gitlabhq",
"group": "qa-perf-testing",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["1c15f23b", "ccf4f103"],
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"user": "root"
"data": {
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
},
{
"name": "gitlabhq2",
"group": "qa-perf-testing",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["1c15f23b", "ccf4f103"],
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"user": "root"
"data": {
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
}
]
}
```
* The environment's Name and URL.
* Note as a convenience these two settings can also be defined as environment variables, `ENVIRONMENT_NAME` and `ENVIRONMENT_URL` respectively, for overriding as required.
* Details for each project that the tests should target. You should aim to have each of these details present here and in the target environment otherwise the specific tests that require them will be skipped automatically:
* Details for each project that the tests should target along with it's data. You should aim to have each of these details present here and in the target environment otherwise the specific tests that require them will be skipped automatically:
* `name` - Name of the Project.
* `group` - The name of the Group that contains the intended Project.
* `branch` - The name of a large branch available in the project. The size of the branch should be tuned to your environment's requirements.
* `commit_sha` - The SHA reference of a large commit available in the project. The size of the commit should be tuned to your environment's requirements.
* `commit_sha_signed` - The SHA reference of a [signed commit](https://docs.gitlab.com/ee/user/project/repository/gpg_signed_commits/) available in the project.
* `compare_commits_sha` - The SHA references of two commits on the same branch that will be [compared](https://docs.gitlab.com/ee/api/repositories.html#compare-branches-tags-or-commits). The difference between the commits should be tuned to your environment's requirements.
* `git_push_data` - Git push data that will be used for git push test. No need to change anything if you're using `gitlabhq`. To test a custom project or learn more about git push test, please refer to [`Git Push test documentation`](test_docs/git_push.md). The size of the commits should be tuned to your environment's requirements.
* `branch_current_head_sha` - The head commit of the `branch_name` branch.
* `branch_new_head_sha` - Any commit SHA that older then `branch_current_head_sha` on the `branch_name` branch.
* `branch_name` - Existing branch name.
* `branch` - The name of a large branch available in the project. The size of the branch should be tuned to your environment's requirements.
* `file_path` - The relative path to a normal sized file in your project.
* `git_push_data` - Git push data that will be used for git push test. No need to change anything if you're using `gitlabhq`. To test a custom project or learn more about git push test, please refer to [`Git Push test documentation`](test_docs/git_push.md). The size of the commits should be tuned to your environment's requirements.
* `branch_current_head_sha` - The head commit of the `branch_name` branch.
* `branch_new_head_sha` - Any commit SHA that older then `branch_current_head_sha` on the `branch_name` branch.
* `branch_name` - Existing branch name.
* `mr_commits_iid` - The [iid](https://docs.gitlab.com/ee/api/#id-vs-iid) of a merge request available in the project that has a large number of commits. The size of the MR should be tuned to your environment's requirements.
* `mr_discussions_iid` - The [iid](https://docs.gitlab.com/ee/api/#id-vs-iid) of a merge request available in the project that has a large number of discussions / comments. The size of the MR discussions should be tuned to your environment's requirements.
* `search_global` - Search terms of specific types of data used for testing the [Global Search API](https://docs.gitlab.com/ee/api/search.html#global-search-api). This should be adapted to the project you're using with the aim of each search bring back a good number of results tuned to your environment's requirements. Currently the data can be search is `projects`, `issues`, `merge_requests`, `milestones` and `users`. Note that all of these are currently required for this test.
* `user` - The name of a valid user for testing related endpoints.
### Options
......@@ -239,7 +259,7 @@ The recommended way to run the Tool is with our Docker image, [gitlab/gitlab-per
The image will start running the tests when it's called. The full options for running the tool can be seen by getting the help output by running `docker run -it gitlab/gitlab-performance-tool --help`:
```
GitLab Performance Tool (GPT) v1.1.2 - Performance test runner for GitLab environments based on k6
GitLab Performance Tool (GPT) v1.2 - Performance test runner for GitLab environments based on k6
Documentation: https://gitlab.com/gitlab-org/quality/performance/blob/master/docs/README.md
......
......@@ -7,35 +7,49 @@
{
"name": "gitlabhq",
"group": "qa-perf-testing",
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
},
{
"name": "gitlabhq2",
"group": "qa-perf-testing",
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
......@@ -7,35 +7,49 @@
{
"name": "gitlabhq",
"group": "qa-perf-testing",
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
},
{
"name": "gitlabhq2",
"group": "qa-perf-testing",
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
......@@ -7,35 +7,49 @@
{
"name": "gitlabhq",
"group": "qa-perf-testing",
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
},
{
"name": "gitlabhq2",
"group": "qa-perf-testing",
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
......@@ -7,69 +7,97 @@
{
"name": "gitlabhq",
"group": "qa-perf-testing",
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
},
{
"name": "gitlabhq2",
"group": "qa-perf-testing",
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
},
{
"name": "gitlabhq3",
"group": "qa-perf-testing",
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
},
{
"name": "gitlabhq4",
"group": "qa-perf-testing",
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
......@@ -7,36 +7,56 @@
{
"name": "gitlabhq",
"group": "qa-perf-testing",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"user": "root"
"data": {
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
},
{
"name": "gitlabhq2",
"group": "qa-perf-testing",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"user": "root"
"data": {
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
}
},
"user": "root"
}
}
]
}
......@@ -7,18 +7,25 @@
{
"name": "gitlabhq",
"group": "qa-perf-testing",
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
......@@ -7,18 +7,25 @@
{
"name": "gitlabhq",
"group": "qa-perf-testing",
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
......@@ -7,18 +7,25 @@
{
"name": "gitlabhq",
"group": "qa-perf-testing",
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "efc9f72c9ffaa76f966b8c162a9d184d7aa1ff18",
"branch_new_head_sha": "b028afaede664580e04cddf0dd98faeff28ffbef",
"branch_name": "12-1-auto-deploy-0011201"
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
},
"branch": "10-0-stable",
"file_path": "qa%2fqa%2erb",
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
/*global __ENV : true */
/*
@endpoint: `GET /search?scope=*`
@description: [Global Search](https://docs.gitlab.com/ee/api/search.html#global-search-api)
*/
import http from "k6/http";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
export let endpointCount = 5
export let rpsThresholds = getRpsThresholds(0.3, endpointCount)
export let ttfbThreshold = getTtfbThreshold(17500)
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
"successful_requests": [`rate>${__ENV.SUCCESS_RATE_THRESHOLD}`],
"http_req_waiting{endpoint:projects}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:issues}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:merge_requests}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:milestones}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:users}": [`p(90)<${ttfbThreshold}`],
"http_reqs": [`count>=${rpsThresholds['count']}`],
"http_reqs{endpoint:projects}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:issues}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:merge_requests}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:milestones}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:users}": [`count>=${rpsThresholds['count_per_endpoint']}`],
}
};
export let projects = getProjects(['search_global']);
export function setup() {
console.log('')
console.log(`RPS Threshold: ${rpsThresholds['mean']}/s (${rpsThresholds['count']})`)
console.log(`RPS Threshold per Endpoint: ${rpsThresholds['mean_per_endpoint']}/s (${rpsThresholds['count_per_endpoint']})`)
console.log(`TTFB P90 Threshold: ${ttfbThreshold}ms`)
console.log(`Success Rate Threshold: ${parseFloat(__ENV.SUCCESS_RATE_THRESHOLD)*100}%`)
}
export default function() {
group("API - Global Search", function() {
let project = selectProject(projects);
let params = { headers: { "Accept": "application/json", "PRIVATE-TOKEN": `${__ENV.ACCESS_TOKEN}` } };
let responses = http.batch([
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=projects&search=${project['search_global']['projects']}`, null, Object.assign({}, params, { tags: { endpoint: 'projects' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=issues&search=${project['search_global']['issues']}`, null, Object.assign({}, params, { tags: { endpoint: 'issues' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=merge_requests&search=${project['search_global']['merge_requests']}`, null, Object.assign({}, params, { tags: { endpoint: 'merge_requests' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=milestones&search=${project['search_global']['milestones']}`, null, Object.assign({}, params, { tags: { endpoint: 'milestones' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=users&search=${project['search_global']['users']}`, null, Object.assign({}, params, { tags: { endpoint: 'users' } })],
]);
responses.forEach(function(res) {
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
});
});
}
/*global __ENV : true */
/*
@endpoint: `GET /:search`
@description: Web - Global Search <br>Controllers: `SearchController#show`,`SearchController#count`</br>
*/
import http from "k6/http";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, adjustRps, adjustStageVUs, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
export let endpointCount = 10
export let webProtoRps = adjustRps(__ENV.WEB_ENDPOINT_THROUGHPUT)
export let webProtoStages = adjustStageVUs(__ENV.WEB_ENDPOINT_THROUGHPUT)
export let rpsThresholds = getRpsThresholds(__ENV.WEB_ENDPOINT_THROUGHPUT, endpointCount)
export let ttfbThreshold = getTtfbThreshold(1000)
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
"successful_requests": [`rate>${__ENV.SUCCESS_RATE_THRESHOLD}`],
"http_req_waiting{endpoint:projects}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:projects_count}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:issues}": [`p(90)<${ttfbThreshold}`],