Commit 57ad812d authored by Grant Young's avatar Grant Young

Add gitlab_version to web mr discussions

widget.json wasn't available until then
parent 0aa24a8f
......@@ -4,6 +4,8 @@ The GitLab Performance Tool (`gpt`) has been built by the GitLab Quality team to
The tool can be used both manually and automatically, with us doing the latter for automated testing of reference environments via [Pipelines](https://gitlab.com/gitlab-org/quality/performance/pipeline_schedules).
GPT blog post - [How our QA team leverages GitLab’s performance testing tool (and you can too)](https://about.gitlab.com/blog/2020/02/18/how-were-building-up-performance-testing-of-gitlab/)
## Documentation
Documentation on how to use the tool can be found in the [`docs/`](/docs/README.md) folder:
......
......@@ -16,7 +16,7 @@ require 'tmpdir'
k6_dir = Pathname.new(File.expand_path('../k6', __dir__)).relative_path_from(Dir.pwd)
gpt_version = '1.2.4'
gpt_version = '1.2.5'
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
......
......@@ -240,7 +240,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.2.4 - Performance test runner for GitLab environments based on k6
GitLab Performance Tool (GPT) v1.2.5 - Performance test runner for GitLab environments based on k6
Documentation: https://gitlab.com/gitlab-org/quality/performance/blob/master/docs/README.md
......
import http from "k6/http";
import { fail } from "k6";
/* Certain Project Endpoint Paths can have an additional dash (-) depending on GitLab version.
When this is the case some will redirect if that dash is missing, which inflates k6's numbers
as they count redirects twice.
This function can be used to check if an endpoint path does redirect and pass that back into
the test and maintain the numbers. */
export function checkProjEndpointPath(projectPath, endpointPath) {
let res = http.get(`${projectPath}/${endpointPath}`);
if (!/20(0|1)/.test(res.status)) fail(`Failed to check if Project Endpoint path '${projectPath}/${endpointPath}' is correct - ${res.body}`);
let pathRegex = new RegExp(`${projectPath}/(.*)`);
let actualPath = res.url.match(pathRegex)[1];
return actualPath
}
\ No newline at end of file
{
"stages": [
{ "duration": "5s", "target": 20 },
{ "duration": "50s", "target": 20 },
{ "duration": "5s", "target": 0 }
],
"rps": 20,
"batchPerHost": 0
}
/*global __ENV : true */
/*
@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`
@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
*/
......
......@@ -3,12 +3,14 @@
@endpoint: `GET /:group/:project/branches`
@description: Web - Project Branches Page. <br>Controllers: `BranchesController#show`, `Projects::BranchesController#diverging_commit_counts`</br>
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/211710
@flags: dash_url
*/
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";
import { checkProjEndpointPath } from "../../lib/gpt_web_functions.js";
export let endpointCount = 2
export let webProtoRps = adjustRps(__ENV.WEB_ENDPOINT_THROUGHPUT)
......@@ -38,15 +40,21 @@ export function setup() {
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}%`)
// Check if endpoint path has a dash \ redirect
let checkProject = selectProject(projects)
let endpointPath = checkProjEndpointPath(`${__ENV.ENVIRONMENT_URL}/${checkProject['group']}/${checkProject['name']}`, 'branches')
console.log(`Endpoint path is '${endpointPath}'`)
return { endpointPath };
}
export default function() {
export default function(data) {
group("Web - Project Branches Page", function() {
let project = selectProject(projects);
let responses = http.batch([
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/branches`, null, {tags: {endpoint: 'branches', controller: 'Projects::BranchesController', action: 'show'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/branches/all`, null, {tags: {endpoint: 'branches/all', controller: 'Projects::MergeRequestsController', action: 'show'}}]
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}`, null, {tags: {endpoint: 'branches', controller: 'Projects::BranchesController', action: 'show'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/all`, null, {tags: {endpoint: 'branches/all', controller: 'Projects::MergeRequestsController', action: 'show'}}]
]);
responses.forEach(function(res) {
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
......
......@@ -3,12 +3,14 @@
@endpoint: `GET /:group/:project/issues/:issue_iid`
@description: Web - Project Issue Page. <br>Controllers: `Projects::IssuesController#show`, `Projects::IssuesController#discussions`, `Projects::IssuesController#related_branches`, `Projects::IssuesController#can_create_branch` </br>
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/211377
@flags: dash_url
*/
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";
import { checkProjEndpointPath } from "../../lib/gpt_web_functions.js";
export let endpointCount = 5
export let webProtoRps = adjustRps(__ENV.WEB_ENDPOINT_THROUGHPUT)
......@@ -44,18 +46,24 @@ export function setup() {
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}%`)
// Check if endpoint path has a dash \ redirect
let checkProject = selectProject(projects)
let endpointPath = checkProjEndpointPath(`${__ENV.ENVIRONMENT_URL}/${checkProject['group']}/${checkProject['name']}`, 'issues')
console.log(`Endpoint path is '${endpointPath}'`)
return { endpointPath };
}
export default function() {
export default function(data) {
group("Web - Project Issue Page", function() {
let project = selectProject(projects);
let responses = http.batch([
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/issues/${project['issue_iid']}`, null, {tags: {endpoint: 'issue', controller: 'Projects::IssuesController', action: 'show'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/issues/${project['issue_iid']}/realtime_changes`, null, {tags: {endpoint: 'realtime_changes', controller: 'Projects::IssuesController', action: 'realtime_changes'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/issues/${project['issue_iid']}/discussions.json`, null, {tags: {endpoint: 'discussions.json', controller: 'Projects::IssuesController', action: 'discussions.json'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/issues/${project['issue_iid']}/related_branches`, null, {tags: {endpoint: 'related_branches', controller: 'Projects::IssuesController', action: 'related_branches'}, headers: { 'Accept': 'application/json' }}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/issues/${project['issue_iid']}/can_create_branch`, null, {tags: {endpoint: 'can_create_branch', controller: 'Projects::IssuesController', action: 'can_create_branch'}, headers: { 'Accept': 'application/json' }}]
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/${project['issue_iid']}`, null, {tags: {endpoint: 'issue', controller: 'Projects::IssuesController', action: 'show'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/${project['issue_iid']}/realtime_changes`, null, {tags: {endpoint: 'realtime_changes', controller: 'Projects::IssuesController', action: 'realtime_changes'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/${project['issue_iid']}/discussions.json`, null, {tags: {endpoint: 'discussions.json', controller: 'Projects::IssuesController', action: 'discussions.json'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/${project['issue_iid']}/related_branches`, null, {tags: {endpoint: 'related_branches', controller: 'Projects::IssuesController', action: 'related_branches'}, headers: { 'Accept': 'application/json' }}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/${project['issue_iid']}/can_create_branch`, null, {tags: {endpoint: 'can_create_branch', controller: 'Projects::IssuesController', action: 'can_create_branch'}, headers: { 'Accept': 'application/json' }}]
]);
responses.forEach(function(res) {
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
......
......@@ -2,12 +2,14 @@
/*
@endpoint: `GET /:group/:project/issues`
@description: Web - Project Issues Page. <br>Controllers: `Projects::IssuesController#index`</br>
@flags: dash_url
*/
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";
import { checkProjEndpointPath } from "../../lib/gpt_web_functions.js";
export let webProtoRps = adjustRps(__ENV.WEB_ENDPOINT_THROUGHPUT)
export let webProtoStages = adjustStageVUs(__ENV.WEB_ENDPOINT_THROUGHPUT)
......@@ -31,13 +33,19 @@ export function setup() {
console.log(`RPS Threshold: ${rpsThresholds['mean']}/s (${rpsThresholds['count']})`)
console.log(`TTFB P90 Threshold: ${ttfbThreshold}ms`)
console.log(`Success Rate Threshold: ${parseFloat(__ENV.SUCCESS_RATE_THRESHOLD)*100}%`)
// Check if endpoint path has a dash \ redirect
let checkProject = selectProject(projects)
let endpointPath = checkProjEndpointPath(`${__ENV.ENVIRONMENT_URL}/${checkProject['group']}/${checkProject['name']}`, 'issues')
console.log(`Endpoint path is '${endpointPath}'`)
return { endpointPath };
}
export default function() {
export default function(data) {
group("Web - Project Issues Page", function() {
let project = selectProject(projects);
let res = http.get(`${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/issues`);
let res = http.get(`${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}`);
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
});
}
......@@ -4,12 +4,14 @@
@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/209786
@gitlab_version: 12.7.0
@flags: dash_url
*/
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";
import { checkProjEndpointPath } from "../../lib/gpt_web_functions.js";
export let endpointCount = 7
export let webProtoRps = adjustRps(__ENV.WEB_ENDPOINT_THROUGHPUT)
......@@ -41,16 +43,22 @@ export function setup() {
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}%`)
// Check if endpoint path has a dash \ redirect
let checkProject = selectProject(projects)
let endpointPath = checkProjEndpointPath(`${__ENV.ENVIRONMENT_URL}/${checkProject['group']}/${checkProject['name']}`, 'merge_requests')
console.log(`Endpoint path is '${endpointPath}'`)
return { endpointPath };
}
export default function() {
export default function(data) {
group("Web - Merge Request Changes Page", function() {
let project = selectProject(projects);
let responses = http.batch([
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/merge_requests/${project['mr_commits_iid']}/diffs`, null, {tags: {endpoint: 'diffs', controller: 'Projects::MergeRequestsController', action: 'show'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/merge_requests/${project['mr_commits_iid']}/diffs_metadata.json?`, null, {tags: {endpoint: 'diffs_metadata.json', controller: 'Projects::MergeRequests::DiffsController', action: 'diffs_metadata.json'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/merge_requests/${project['mr_commits_iid']}/diffs_batch.json?w=0&per_page=20&page=1`, null, {tags: {endpoint: 'diffs_batch.json', controller: 'Projects::MergeRequests::DiffsController', action: 'diffs_batch.json'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/${project['mr_commits_iid']}/diffs`, null, {tags: {endpoint: 'diffs', controller: 'Projects::MergeRequestsController', action: 'show'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/${project['mr_commits_iid']}/diffs_metadata.json?`, null, {tags: {endpoint: 'diffs_metadata.json', controller: 'Projects::MergeRequests::DiffsController', action: 'diffs_metadata.json'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/${project['mr_commits_iid']}/diffs_batch.json?w=0&per_page=20&page=1`, null, {tags: {endpoint: 'diffs_batch.json', controller: 'Projects::MergeRequests::DiffsController', action: 'diffs_batch.json'}}],
]);
responses.forEach(function(res) {
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
......@@ -58,7 +66,7 @@ export default function() {
let seqDiffRes = null
for (let i = 2; i <= 5; i++) {
seqDiffRes = http.get(`${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/merge_requests/${project['mr_commits_iid']}/diffs_batch.json?w=0&per_page=20&page=${i}`, {tags: {endpoint: 'diffs_batch.json', controller: 'Projects::MergeRequests::DiffsController', action: 'diffs_batch.json'}});
seqDiffRes = http.get(`${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/${project['mr_commits_iid']}/diffs_batch.json?w=0&per_page=20&page=${i}`, {tags: {endpoint: 'diffs_batch.json', controller: 'Projects::MergeRequests::DiffsController', action: 'diffs_batch.json'}});
/20(0|1)/.test(seqDiffRes.status) ? successRate.add(true) : (successRate.add(false), logError(seqDiffRes));
}
});
......
......@@ -3,13 +3,14 @@
@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/209912
@flags: repo_storage
@flags: repo_storage, dash_url
*/
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";
import { checkProjEndpointPath } from "../../lib/gpt_web_functions.js";
export let endpointCount = 2
export let webProtoRps = adjustRps(__ENV.WEB_ENDPOINT_THROUGHPUT)
......@@ -39,15 +40,21 @@ export function setup() {
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}%`)
// Check if endpoint path has a dash \ redirect
let checkProject = selectProject(projects)
let endpointPath = checkProjEndpointPath(`${__ENV.ENVIRONMENT_URL}/${checkProject['group']}/${checkProject['name']}`, 'merge_requests')
console.log(`Endpoint path is '${endpointPath}'`)
return { endpointPath };
}
export default function() {
export default function(data) {
group("Web - Merge Request Commits Page", function() {
let project = selectProject(projects);
let responses = http.batch([
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/merge_requests/${project['mr_commits_iid']}/commits`, null, {tags: {endpoint: 'commits', controller: 'Projects::MergeRequestsController', action: 'show'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/merge_requests/${project['mr_commits_iid']}/commits.json`, null, {tags: {endpoint: 'commits.json', controller: 'Projects::MergeRequestsController', action: 'commits.json'}}]
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/${project['mr_commits_iid']}/commits`, null, {tags: {endpoint: 'commits', controller: 'Projects::MergeRequestsController', action: 'show'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/${project['mr_commits_iid']}/commits.json`, null, {tags: {endpoint: 'commits.json', controller: 'Projects::MergeRequestsController', action: 'commits.json'}}]
]);
responses.forEach(function(res) {
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
......
......@@ -3,12 +3,15 @@
@endpoint: `GET /:group/:project/merge_requests/:merge_request_iid`
@description: Web - Project Merge Request Discussions Page. <br>Controllers: `Projects::MergeRequestsController#show`, `Projects::MergeRequests::ContentController#widget.json`, `Projects::MergeRequestsController#discussions.json`</br>
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/209784
@gitlab_version: 12.2.0
@flags: dash_url
*/
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";
import { checkProjEndpointPath } from "../../lib/gpt_web_functions.js";
export let endpointCount = 3
export let webProtoRps = adjustRps(__ENV.WEB_ENDPOINT_THROUGHPUT)
......@@ -40,16 +43,22 @@ export function setup() {
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}%`)
// Check if endpoint path has a dash \ redirect
let checkProject = selectProject(projects)
let endpointPath = checkProjEndpointPath(`${__ENV.ENVIRONMENT_URL}/${checkProject['group']}/${checkProject['name']}`, 'merge_requests')
console.log(`Endpoint path is '${endpointPath}'`)
return { endpointPath };
}
export default function() {
export default function(data) {
group("Web - Project Merge Request Discussions Page", function() {
let project = selectProject(projects);
let responses = http.batch([
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/merge_requests/${project['mr_discussions_iid']}`, null, {tags: {endpoint: 'merge_request', controller: 'Projects::MergeRequestsController', action: 'show'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/merge_requests/${project['mr_discussions_iid']}/discussions.json`, null, {tags: {endpoint: 'discussions.json', controller: 'Projects::MergeRequestsController', action: 'discussions.json'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/merge_requests/${project['mr_discussions_iid']}/widget.json`, null, {tags: {endpoint: 'widget.json', controller: 'Projects::MergeRequests::ContentController', action: 'widget.json'}}]
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/${project['mr_discussions_iid']}`, null, {tags: {endpoint: 'merge_request', controller: 'Projects::MergeRequestsController', action: 'show'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/${project['mr_discussions_iid']}/discussions.json`, null, {tags: {endpoint: 'discussions.json', controller: 'Projects::MergeRequestsController', action: 'discussions.json'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}/${project['mr_discussions_iid']}/widget.json`, null, {tags: {endpoint: 'widget.json', controller: 'Projects::MergeRequests::ContentController', action: 'widget.json'}}]
]);
responses.forEach(function(res) {
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
......
......@@ -2,12 +2,14 @@
/*
@endpoint: `GET /:group/:project/merge_requests`
@description: Web - Project Merge Requests Page. <br>Controllers: `Projects::MergeRequestsController#index`</br>
@flags: dash_url
*/
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";
import { checkProjEndpointPath } from "../../lib/gpt_web_functions.js";
export let webProtoRps = adjustRps(__ENV.WEB_ENDPOINT_THROUGHPUT)
export let webProtoStages = adjustStageVUs(__ENV.WEB_ENDPOINT_THROUGHPUT)
......@@ -31,13 +33,19 @@ export function setup() {
console.log(`RPS Threshold: ${rpsThresholds['mean']}/s (${rpsThresholds['count']})`)
console.log(`TTFB P90 Threshold: ${ttfbThreshold}ms`)
console.log(`Success Rate Threshold: ${parseFloat(__ENV.SUCCESS_RATE_THRESHOLD)*100}%`)
// Check if endpoint path has a dash \ redirect
let checkProject = selectProject(projects)
let endpointPath = checkProjEndpointPath(`${__ENV.ENVIRONMENT_URL}/${checkProject['group']}/${checkProject['name']}`, 'merge_requests')
console.log(`Endpoint path is '${endpointPath}'`)
return { endpointPath };
}
export default function() {
export default function(data) {
group("Web - Project Merge Requests Page", function() {
let project = selectProject(projects);
let res = http.get(`${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/merge_requests`);
let res = http.get(`${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/${data.endpointPath}`);
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
});
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment