Commit a45f9996 authored by Grant Young's avatar Grant Young

Add option to use influxdb for k6 again

User request
parent c14cd95d
......@@ -76,7 +76,8 @@ if results_file && File.extname(results_file) == '.json'
results_summary = RunK6.generate_results_summary(results_json: results_json)
results_table = RunK6.generate_results_table(results_json: results_json)
results_footer = RunK6.generate_results_footer(results_json: results_json)
content = "#{results_summary}\n#{results_table}\n#{results_footer}"
content = "#{results_summary}\n#{results_table}"
content << "\n#{results_footer}" unless results_footer.empty?
# Remove any terminal ANSI codes
content.gsub!(/\e\[([;\d]+)?m/, '')
......
......@@ -80,7 +80,8 @@ results_list.each do |results|
results_footer = RunK6.generate_results_footer(results_json: results)
results_comparision_contents << "\n## #{results['name'].capitalize} - #{results['version']}\n" unless results_list.length == 1
results_comparision_contents << "#{results_summary}\n\n#{results_table}\n\n#{results_footer}\n"
results_comparision_contents << "#{results_summary}\n\n#{results_table}\n"
results_comparision_contents << "\n#{results_footer}\n" unless results_footer.empty?
# Remove any terminal ANSI codes
results_comparision_contents.gsub!(/\e\[([;\d]+)?m/, '')
end
......
......@@ -16,7 +16,7 @@ require 'tmpdir'
k6_dir = Pathname.new(File.expand_path('../k6', __dir__)).relative_path_from(Dir.pwd)
gpt_version = '1.2.2'
gpt_version = '1.2.3'
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
......@@ -30,8 +30,9 @@ opts = Optimist.options do
opt :tests, "Names of Test files or directories to run with. When directory given tests will be recursively added from api, web and git subdirs.", type: :strings, default: ["tests"]
opt :scenarios, "Include any tests inside the test directory's scenarios subfolder when true.", type: :flag, default: false
opt :quarantined, "Include any tests inside the test directory's quarantined subfolder when true.", type: :flag, default: false
opt :excludes, "List of words used to exclude tests by matching against their names.", type: :strings, default: []
opt :excludes, "List of words used to exclude tests by matching against their names.", type: :strings
opt :unsafe, "Include any tests that perform unsafe requests (POST, PUT, DELETE, PATCH)", type: :flag, default: false
opt :influxdb_url, "URL of an Influx DB server where GPT can optionally upload test run statistics.", type: :string
banner "\nEnvironment Variable(s):"
banner " ACCESS_TOKEN A valid GitLab Personal Access Token for the specified environment that's required by various tests. The token should come from a User that has admin access for the project(s) to be tested and have API, read_repository, and write_repository permissions. (Default: nil)"
banner "\nExamples:"
......@@ -73,7 +74,7 @@ aggregated_success = true
# Run tests
tests.each do |test_file|
status, output = RunK6.run_k6(k6_path: k6_path, env_vars: env_vars, options_file: options_file, test_file: test_file, gpt_version: gpt_version)
status, output = RunK6.run_k6(k6_path: k6_path, opts: opts, env_vars: env_vars, options_file: options_file, test_file: test_file, gpt_version: gpt_version)
File.open(results_output_file, 'a') do |out_file|
out_file.puts output
......
......@@ -5,21 +5,13 @@
Before running any of the tests they require that the GitLab environment is prepared. This involves seeding the environment with one or more representative [Projects](https://docs.gitlab.com/ee/user/project/) along with setting up an [Access Token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html) for authentication.
* [Test Project(s) Setup](#test-projects-setup)
* [Importing via UI](#importing-via-ui)
* [Importing via the `import-project` script](#importing-via-the-import-project-script)
* [Importing via GitHub](#importing-via-github)
* [Advanced Setup](#advanced-setup)
* [One or more Gitaly nodes](#one-or-more-gitaly-nodes)
* [Troubleshooting](#troubleshooting)
* [Gitaly calls error when importing](#gitaly-calls-error-when-importing)
* [Access Token Setup](#access-token-setup)
[[_TOC_]]
## Test Project(s) Setup
The tests require that there's representative data in the environment. This is done with one or more [Projects](https://docs.gitlab.com/ee/user/project/) that would be representative of typically larger projects that the environment is expected to contain.
At GitLab, the default setup for the tests is importing our own [GitLab FOSS](https://gitlab.com/gitlab-org/gitlab-foss/) project (named `gitlabhq` in this case) under a group named `qa-perf-testing`. Project tarballs that we use for performance testing can be found over on the [performance-data](https://gitlab.com/gitlab-org/quality/performance-data) project. A different project can be used if required but will need to be configured accordingly for the tool to use it as per the [k6 Test Configuration section](./k6.md#test-configuration).
At GitLab, the default setup for the tests is importing our own [GitLab FOSS](https://gitlab.com/gitlab-org/gitlab-foss/) project (named `gitlabhq` in this case) under a group named `qa-perf-testing`. Project tarballs that we use for performance testing can be found over on the [performance-data](https://gitlab.com/gitlab-org/quality/performance-data) project. A different project can be used if required but will need to be configured accordingly for the tool to use it as per the [k6 Test Configuration section](./k6.md#test-configuration). **Note that in all cases the GPT expects all projects to be Public else some tests will fail**.
There's several options for importing the project into your GitLab environment. They are detailed as follows with the assumption that the recommended group `qa-perf-testing` and project `gitlabhq` are being set up:
......
......@@ -7,23 +7,7 @@ On this page we'll detail how to configure and run [k6](https://k6.io/) tests ag
**Note: Before running any tests with the Tool, the intended GitLab environment should be prepared first. Details on how to do this can be found here: [GitLab Performance Tool - Preparing the Environment](environment_prep.md)**
* [Tool Requirements](#tool-requirements)
* [Configuring the Tool](#configuring-the-tool)
* [Environments](#environments)
* [Options](#options)
* [Tests](#tests)
* [Test Types](#test-types)
* [Unsafe Tests](#unsafe-tests)
* [Running the Tests with the Tool](#running-the-tests-with-the-tool)
* [Docker (Recommended)](#docker-recommended)
* [Linux](#linux)
* [Location and Network conditions](#location-and-network-conditions)
* [Test Output and Results](#test-output-and-results)
* [Test Thresholds](#test-thresholds)
* [Evaluating Failures](#evaluating-failures)
* [Comparing Results](#comparing-results)
* [Troubleshooting](#troubleshooting)
* [`socket: too many open files`](#socket-too-many-open-files)
[[_TOC_]]
## Tool Requirements
......@@ -173,11 +157,11 @@ As an example, the following is one of our API Tests, [`api_v4_projects_project.
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold()
......@@ -255,20 +239,21 @@ 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.2.2 - Performance test runner for GitLab environments based on k6
GitLab Performance Tool (GPT) v1.2.3 - Performance test runner for GitLab environments based on k6
Documentation: https://gitlab.com/gitlab-org/quality/performance/blob/master/docs/README.md
Usage: run-k6 [options]
Options:
-h, --help Show this help message
-e, --environment=<s> Name of Environment Config file in environments directory that the test(s) will be run with. Alternative filepath can also be given.
-o, --options=<s> Name of Options Config file in options directory that the test(s) will be run with. Alternative filepath can also be given. (Default: 20s_2rps.json)
-t, --tests=<s+> Names of Test files or directories to run with. When directory given tests will be recursively added from api, web and git subdirs. (Default: tests)
-s, --scenarios Include any tests inside the test directory's scenarios subfolder when true.
-q, --quarantined Include any tests inside the test directory's quarantined subfolder when true.
-x, --excludes=<s+> List of words used to exclude tests by matching against their names. (Default: )
-u, --unsafe Include any tests that perform unsafe requests (POST, PUT, DELETE, PATCH)
-h, --help Show this help message
-e, --environment=<s> Name of Environment Config file in environments directory that the test(s) will be run with. Alternative filepath can also be given.
-o, --options=<s> Name of Options Config file in options directory that the test(s) will be run with. Alternative filepath can also be given. (Default: 20s_2rps.json)
-t, --tests=<s+> Names of Test files or directories to run with. When directory given tests will be recursively added from api, web and git subdirs. (Default: tests)
-s, --scenarios Include any tests inside the test directory's scenarios subfolder when true.
-q, --quarantined Include any tests inside the test directory's quarantined subfolder when true.
-x, --excludes=<s+> List of words used to exclude tests by matching against their names.
-u, --unsafe Include any tests that perform unsafe requests (POST, PUT, DELETE, PATCH)
-i, --influxdb-url=<s> URL of an Influx DB server where GPT can optionally upload test run statistics.
Environment Variable(s):
ACCESS_TOKEN A valid GitLab Personal Access Token for the specified environment that's required by various tests. The token should come from a User that has admin access for
......@@ -445,3 +430,7 @@ In this section we'll detail any known potential problems when running `k6` and
You may see `k6` throw the error `socket: too many open files` many times if you're running a test with particularly high amount of virtual users and throughput, e.g. More than 200 users / RPS.
When this happens it's due to the underlying OS having a limit for how many files can be open at one time, also known as file descriptors. This can be fixed by increasing the number of files that are allowed to be open in the OS. How this is done typically is dependent on the type and version of the OS and you should refer to it's documentation. For example though here are links on how to normally do this on [Linux](https://www.tecmint.com/increase-set-open-file-limits-in-linux/) and [Mac OS](https://medium.com/mindful-technology/too-many-open-files-limit-ulimit-on-mac-os-x-add0f1bfddde) respectively. Another workaround is to run the tests in Docker, which typically have higher limits by default.
### Tests failing due to sign in page redirect
If you're seeing some tests fail, especially web tests, with a redirect error showing in the logs this will likely be due to the target Project not being set as public. The GPT tests all expect the test Project's to have public visibility. After changing the Projects the tests should start to work.
......@@ -18,6 +18,10 @@ export function logError(res) {
}
}
export function checkAccessToken() {
if (!__ENV.ACCESS_TOKEN) fail('Missing Environment Variable: Test required enviroment variable ACCESS_TOKEN has not been set. Refer to docs for more info. Skipping...')
}
export function getRpsThresholds(modifier=1.0, endpoints=1) {
let buffer = __ENV.RPS_THRESHOLD_MULTIPLIER
let thresholds = {
......@@ -60,7 +64,7 @@ export function getProjects(keys=[]) {
projects_with_keys = projects.filter(project => checkProjectKeys(project, keys));
}
if (projects_with_keys.length == 0) fail('No projects found with required keys for test. Exiting...');
if (projects_with_keys.length == 0) fail(`Missing Project Config Data: No projects in Environment config were found with the following required data - ${keys.join(', ')}. Update your Environment config to have this data and rerun. Refer to docs for more info. Exiting...`);
return projects_with_keys
}
......
......@@ -11,7 +11,7 @@ import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold(1000)
export let ttfbThreshold = getTtfbThreshold(1500)
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
......@@ -5,11 +5,11 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold()
......
......@@ -5,13 +5,13 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
// Token not typically required for this endpoint but it was in 11.10 \ 11.11 due to a bug
// https://gitlab.com/gitlab-org/gitlab-foss/issues/60425
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold()
......
......@@ -2,7 +2,7 @@
/*
@endpoint: `GET /projects/:id/merge_requests`
@description: [Get all merge requests for this project](https://docs.gitlab.com/ee/api/merge_requests.html#list-project-merge-requests)
@issue: https://gitlab.com/gitlab-org/gitlab/issues/33150, https://gitlab.com/gitlab-org/gitlab/issues/30180
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/209780
*/
import http from "k6/http";
......
......@@ -2,15 +2,15 @@
/*
@endpoint: `GET /projects/:id/merge_requests/:merge_request_iid/discussions`
@description: [Gets a list of all discussion items for a single merge request](https://docs.gitlab.com/ee/api/discussions.html#list-project-merge-request-discussion-items)
@issue: https://gitlab.com/gitlab-org/gitlab/issues/32455
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/32455
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
// Endpoint is below target threshold. Custom lower limit applied until fixed.
export let rpsThresholds = getRpsThresholds(0.2)
......
......@@ -5,11 +5,11 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold()
......
......@@ -5,11 +5,11 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold()
......
......@@ -2,6 +2,7 @@
/*
@endpoint: `GET /projects/:id/search?scope=blobs&search=:query`
@description: [Search throught the code within the specified project](https://docs.gitlab.com/ee/api/search.html#scope-blobs)
@flags: repo_storage
*/
import http from "k6/http";
......@@ -9,8 +10,8 @@ import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold()
export let rpsThresholds = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getRpsThresholds(0.5) : getRpsThresholds()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(3000) : getTtfbThreshold()
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
......@@ -6,11 +6,11 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold()
......
......@@ -2,16 +2,16 @@
/*
@endpoint: `GET /projects/:id/repository/branches`
@description: [Get a list of repository branches from a project, sorted by name alphabetically](https://docs.gitlab.com/ee/api/branches.html#list-repository-branches)
@issue: https://gitlab.com/gitlab-org/gitlab/issues/30536
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/208738
@flags: repo_storage
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
// Endpoint is below target threshold. Custom lower limit applied until fixed.
export let rpsThresholds = getRpsThresholds(0.05)
......
......@@ -6,14 +6,14 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getRpsThresholds(0.5) : getRpsThresholds()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(2500) : getTtfbThreshold()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(3000) : getTtfbThreshold()
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
......@@ -6,14 +6,14 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getRpsThresholds(0.5) : getRpsThresholds()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(2500) : getTtfbThreshold()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(3000) : getTtfbThreshold()
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
......@@ -6,14 +6,14 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getRpsThresholds(0.5) : getRpsThresholds()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(2500) : getTtfbThreshold()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(3000) : getTtfbThreshold()
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
......@@ -6,14 +6,14 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getRpsThresholds(0.5) : getRpsThresholds()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(2500) : getTtfbThreshold()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(3000) : getTtfbThreshold()
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
......@@ -7,14 +7,14 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getRpsThresholds(0.5) : getRpsThresholds()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(2500) : getTtfbThreshold()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(3000) : getTtfbThreshold()
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
......@@ -6,14 +6,14 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getRpsThresholds(0.5) : getRpsThresholds()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(2500) : getTtfbThreshold()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(8000) : getTtfbThreshold()
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
......@@ -6,14 +6,14 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getRpsThresholds(0.5) : getRpsThresholds()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(2500) : getTtfbThreshold()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(3000) : getTtfbThreshold()
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
......@@ -6,14 +6,14 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getRpsThresholds(0.5) : getRpsThresholds()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(2500) : getTtfbThreshold()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(3000) : getTtfbThreshold()
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
......@@ -6,14 +6,14 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getRpsThresholds(0.5) : getRpsThresholds()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(2500) : getTtfbThreshold()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(3000) : getTtfbThreshold()
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
......@@ -5,11 +5,11 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold()
......
......@@ -5,11 +5,11 @@
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold()
......
......@@ -2,15 +2,16 @@
/*
@endpoint: `GET /:group/:project.git/info/refs?service=git-receive-pack` <br> `POST /:group/:project.git/git-receive-pack` </br>
@description: Git push commit(s) via HTTPS. <br> Documentation: https://gitlab.com/gitlab-org/quality/performance/-/blob/master/docs/test_docs/git_push.md`
@flags: unsafe
*/
import http from "k6/http";
import { group, fail } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject, checkProjectKeys, adjustRps, adjustStageVUs } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject, checkProjectKeys, adjustRps, adjustStageVUs } from "../../lib/gpt_k6_modules.js";
import { getRefsListGitPush, pushRefsData, checkCommitExists, prepareGitPushData, updateProjectPipelinesSetting, waitForGitSidekiqQueue } from "../../lib/gpt_git_functions.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let gitProtoRps = adjustRps(__ENV.GIT_ENDPOINT_THROUGHPUT)
export let gitProtoStages = adjustStageVUs(__ENV.GIT_ENDPOINT_THROUGHPUT)
......
......@@ -3,15 +3,16 @@
@endpoint: `POST /projects/:id/repository/branches`
@description: [Create a new branch in the repository](https://docs.gitlab.com/ee/api/branches.html#create-repository-branch)
@issue: https://gitlab.com/gitlab-org/gitlab/issues/196788
@flags: unsafe
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, adjustRps, adjustStageVUs } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, adjustRps, adjustStageVUs } from "../../lib/gpt_k6_modules.js";
import { createGroup, createProject, deleteGroup } from "../../lib/gpt_scenario_functions.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let rps = adjustRps(__ENV.SCENARIO_ENDPOINT_THROUGHPUT)
export let stages = adjustStageVUs(__ENV.SCENARIO_ENDPOINT_THROUGHPUT)
......
......@@ -2,15 +2,16 @@
/*
@endpoint: `POST /projects/:id/issues`
@description: Setup stage: Create group and project <br>Test: [Creates a new project issue](https://docs.gitlab.com/ee/api/issues.html#new-issue) <br>Teardown stage: Delete group
@flags: unsafe
*/
import http from "k6/http";
import { group, fail } from "k6";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, adjustRps, adjustStageVUs } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, adjustRps, adjustStageVUs } from "../../lib/gpt_k6_modules.js";
import { createGroup, createProject, deleteGroup } from "../../lib/gpt_scenario_functions.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
checkAccessToken();
export let issueRps = adjustRps(__ENV.SCENARIO_ENDPOINT_THROUGHPUT)
export let issueStages = adjustStageVUs(__ENV.SCENARIO_ENDPOINT_THROUGHPUT)
......
......@@ -2,7 +2,7 @@
/*
@endpoint: `GET /:group/:project/commits/:branch`
@description: Web - Project Commits Page. <br>Controllers: `CommitsController#show`</br>
@issue: https://gitlab.com/gitlab-org/gitlab/issues/31321
@flags: repo_storage
*/
import http from "k6/http";
......@@ -13,8 +13,8 @@ import { logError, getRpsThresholds, getTtfbThreshold, adjustRps, adjustStageVUs
export let endpointCount = 1
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 rpsThresholds = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getRpsThresholds(__ENV.WEB_ENDPOINT_THROUGHPUT * 0.5, endpointCount) : getRpsThresholds(__ENV.WEB_ENDPOINT_THROUGHPUT, endpointCount)
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(3000) : getTtfbThreshold()
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
......@@ -2,7 +2,7 @@
/*
@endpoint: `GET /:group/:project/-/merge_requests/:merge_request_iid/diffs`
@description: Web - Project Merge Request Changes Page. <br>Controllers: `Projects::MergeRequestsController#show`, `Projects::MergeRequests::DiffsController#diffs_metadata.json`, `Projects::MergeRequests::DiffsController#diffs_batch.json`</br>
@issue: https://gitlab.com/gitlab-org/gitlab/issues/30507
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/209784
*/
import http from "k6/http";
......
<
......@@ -2,7 +2,8 @@
/*
@endpoint: `GET /:group/:project/-/merge_requests/:merge_request_iid/commits`
@description: Web - Project Merge Request Commits Page. <br>Controllers: `Projects::MergeRequestsController#show`, `Projects::MergeRequestsController#commits.json`</br>
@issue: https://gitlab.com/gitlab-org/gitlab/issues/30507
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/209912
@flags: repo_storage
*/
import http from "k6/http";
......@@ -13,8 +14,8 @@ import { logError, getRpsThresholds, getTtfbThreshold, adjustRps, adjustStageVUs
export let endpointCount = 2