-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
739 additions
and
503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
locust==2.15.0 | ||
locust==2.28.0 | ||
psycopg==3.1.9 | ||
psycopg2-binary==2.9.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
WIZARD_API_TOKEN = "eyJhbGciOiJSUzI1NiJ9.eyJleHAiOjE3MDc5OTg1NjIsInRlbmFudFV1aWQiOiIwMDA1NWMyNC01M2JkLTRiZGQtODAyMi0xNzk1ZjhlYmY3ZmYiLCJ0b2tlblV1aWQiOiJiZDI3Njk0NS05YTVkLTQxNzgtYmQyNy05NzFlNWVhNTkxNDIiLCJ1c2VyVXVpZCI6IjNlZjk2MDY3LThlN2EtNDc5ZS1hZTE4LTFiZTQ3ZjBlMjAzMiIsInZlcnNpb24iOjR9.LiGklocwHQOLCHDX_vweGjZKVsX1cVNo9xfQRPOKzZ3ZN9b5ss4P80hI71qgHBjTonbblMNqlxYHgGfHIZOUSNbboex6f0Tj0iaGIADpFhw6FsWNXBZ7BgUIfn6y974r-6iREX6PbYxz2vyTnJpOtSV7BwiBJ6nWc3uxLtG4oq7983YG1kuMj6OHnqxk6KKijefE9Cm4de9DdUNr5m-YJQXTTnnszQ3CsiRh68nzTFD6FZHO6xzNRdgham1GDxjUV9WDrWZXQkdTNRn0TUrIo7noExoNDJZUCDO5I-PSGA9Ev216ZCNRV2SqgD-Wgd0SawZdzmYrkhMRkPj5ofcZKVwGvslayvVApujUyOPtdJjxX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lSmftdamcY3qCl9667I6cq3cjm9YXMbVBx0waSmV2OWOwcE2wnnkQsHJ6mmEA8CluGN0YGtvBciEznTt1zBRjSYYQqoGLj7CH_PfhWfaAgaJhQVILIAau9ViFeF88OEzZNWOJQ7TTyT4j_0i2wdlMBfcUyrARZfJzL5IHBU4bV7a6CDmu89Vf45ccM2Kv4QwvqCLqTew9ERI7tnORN7tfozggfgRvAuCU" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from locust import task | ||
|
||
from tests.authorized_base_test import AuthorizedBaseTest | ||
|
||
QTN_UUID = '4d76915c-0f75-4644-a095-cef027059794' | ||
PATH='1e85da40-bbfc-4180-903e-6c569ed2da38.73d686bd-7939-412e-8631-502ee6d9ea7b' | ||
|
||
|
||
class BasicUser(AuthorizedBaseTest): | ||
|
||
@task(5) | ||
def get_questionnaire_settings(self): | ||
self.client.get( | ||
url=f'/questionnaires/{QTN_UUID}/comments?path={PATH}', | ||
headers=self.headers, | ||
) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from locust import task | ||
|
||
from tests.authorized_base_test import AuthorizedBaseTest | ||
|
||
QTN_UUID = '4d76915c-0f75-4644-a095-cef027059794' | ||
|
||
|
||
class BasicUser(AuthorizedBaseTest): | ||
|
||
@task(5) | ||
def get_questionnaire(self): | ||
self.client.get( | ||
url=f'/questionnaires/{QTN_UUID}/questionnaire', | ||
headers=self.headers, | ||
) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from locust import task | ||
|
||
from tests.authorized_base_test import AuthorizedBaseTest | ||
|
||
QTN_UUID = '4d76915c-0f75-4644-a095-cef027059794' | ||
|
||
|
||
class BasicUser(AuthorizedBaseTest): | ||
|
||
@task(5) | ||
def get_questionnaire_settings(self): | ||
self.client.get( | ||
url=f'/questionnaires/{QTN_UUID}/settings', | ||
headers=self.headers, | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,27 +3,30 @@ | |
T_20 = TestVariant(20) | ||
T_40 = TestVariant(40) | ||
T_80 = TestVariant(80) | ||
T_120 = TestVariant(160) | ||
T_160 = TestVariant(160) | ||
|
||
TESTS = [ | ||
Test('config-bootstrap', [T_20, T_40, T_80, T_120]), | ||
Test('document-template-detail', [T_20, T_40, T_80, T_120]), | ||
Test('document-template-list', [T_20, T_40, T_80, T_120]), | ||
Test('document-template-suggestions', [T_20, T_40, T_80, T_120]), | ||
Test('package-detail', [T_20, T_40, T_80, T_120]), | ||
Test('package-list', [T_20, T_40, T_80, T_120]), | ||
Test('package-suggestions', [T_20, T_40, T_80, T_120]), | ||
Test('questionnaire-detail', [T_20]), | ||
Test('questionnaire-detail-documents', [T_20, T_40, T_80, T_120]), | ||
Test('questionnaire-detail-events', [T_20]), | ||
Test('questionnaire-detail-report', [T_20]), | ||
Test('questionnaire-detail-versions', [T_20, T_40, T_80, T_120]), | ||
Test('questionnaire-importer-suggestion', [T_20, T_40, T_80, T_120]), | ||
Test('questionnaire-list', [T_20, T_40]), | ||
Test('questionnaire-project-tag-suggestion', [T_20, T_40, T_80, T_120]), | ||
Test('usage', [T_20, T_40, T_80, T_120]), | ||
Test('users-list', [T_20, T_40, T_80, T_120]), | ||
Test('users-suggestion', [T_20, T_40, T_80, T_120]), | ||
Test('config_bootstrap', [T_20, T_40, T_80, T_160]), | ||
Test('document_template_detail', [T_20, T_40, T_80, T_160]), | ||
Test('document_template_list', [T_20, T_40, T_80, T_160]), | ||
Test('document_template_suggestions', [T_20, T_40, T_80, T_160]), | ||
Test('package_detail', [T_20, T_40, T_80, T_160]), | ||
Test('package_list', [T_20, T_40, T_80, T_160]), | ||
Test('package_suggestions', [T_20, T_40, T_80, T_160]), | ||
Test('questionnaire_detail', [T_20, T_40, T_80, T_160]), | ||
Test('questionnaire_detail_comments', [T_20, T_40, T_80, T_160]), | ||
Test('questionnaire_detail_documents', [T_20, T_40, T_80, T_160]), | ||
Test('questionnaire_detail_events', [T_20, T_40, T_80, T_160]), | ||
Test('questionnaire_detail_questionnaire', [T_20, T_40, T_80, T_160]), | ||
Test('questionnaire_detail_report', [T_20]), | ||
Test('questionnaire_detail_settings', [T_20, T_40, T_80, T_160]), | ||
Test('questionnaire_detail_versions', [T_20, T_40, T_80, T_160]), | ||
Test('questionnaire_importer_suggestion', [T_20, T_40, T_80, T_160]), | ||
Test('questionnaire_list', [T_20, T_40, T_80, T_160]), | ||
Test('questionnaire_project_tag_suggestion', [T_20, T_40, T_80, T_160]), | ||
Test('usage', [T_20, T_40, T_80, T_160]), | ||
Test('users_list', [T_20, T_40, T_80, T_160]), | ||
Test('users_suggestion', [T_20, T_40, T_80, T_160]), | ||
] | ||
|
||
WIZARD_USERNAME = '[email protected]' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,48 @@ | ||
import subprocess | ||
|
||
import tests.questionnaire_detail as questionnaire_detail | ||
import tests.questionnaire_detail_comments as questionnaire_detail_comments | ||
import tests.questionnaire_detail_documents as questionnaire_detail_documents | ||
import tests.questionnaire_detail_events as questionnaire_detail_events | ||
import tests.questionnaire_detail_questionnaire as questionnaire_detail_questionnaire | ||
import tests.questionnaire_detail_report as questionnaire_detail_report | ||
import tests.questionnaire_detail_settings as questionnaire_detail_settings | ||
import tests.questionnaire_detail_versions as questionnaire_detail_versions | ||
from tools.grafana_template import create_target, create_dashboard | ||
|
||
fast_targets_array = [ | ||
create_target("GET /wizard-api/configs/bootstrap", "GET", "url = '/wizard-api/configs/bootstrap'"), | ||
create_target("GET /wizard-api/document-templates", "GET", "url = '/wizard-api/document-templates'"), | ||
create_target("GET /wizard-api/packages", "GET", "url = '/wizard-api/packages'"), | ||
create_target("GET /wizard-api/packages/suggestions", "GET", "url = '/wizard-api/packages/suggestions'"), | ||
create_target("GET /wizard-api/packages/<id>", "GET","url LIKE '/wizard-api/packages/%' AND url != '/wizard-api/packages/suggestions'"), | ||
create_target("GET /wizard-api/questionnaires/project-tags/suggestions", "GET","url = '/wizard-api/questionnaires/project-tags/suggestions'"), | ||
create_target("GET /wizard-api/usage", "GET","url = '/wizard-api/usage'"), | ||
create_target("GET /wizard-api/users", "GET","url LIKE '/wizard-api/users%'"), | ||
] | ||
|
||
slow_targets_array = [ | ||
create_target("GET /wizard-api/document-templates/suggestions", "GET","url = '/wizard-api/document-templates/suggestions'"), | ||
create_target("GET /wizard-api/document-templates/<id>", "GET","url LIKE '/wizard-api/document-templates/%' AND url != '/wizard-api/document-templates/suggestions'"), | ||
create_target("GET /wizard-api/questionnaires", "GET", "url = '/wizard-api/questionnaires'"), | ||
create_target("GET /wizard-api/questionnaires/<id>", "GET", "url = '/wizard-api/questionnaires/8796f923-75f7-4ae2-b53a-cc18ee0ec31d'"), | ||
create_target("GET /wizard-api/questionnaires/<id>/documents", "GET", "url = '/wizard-api/questionnaires/8796f923-75f7-4ae2-b53a-cc18ee0ec31d/documents'"), | ||
create_target("GET /wizard-api/questionnaires/<id>/events", "GET", "url = '/wizard-api/questionnaires/8796f923-75f7-4ae2-b53a-cc18ee0ec31d/events'"), | ||
create_target("GET /wizard-api/questionnaires/<id>/reports", "GET", "url = '/wizard-api/questionnaires/8796f923-75f7-4ae2-b53a-cc18ee0ec31d/reports'"), | ||
create_target("GET /wizard-api/questionnaires/<id>/versions", "GET", "url = '/wizard-api/questionnaires/8796f923-75f7-4ae2-b53a-cc18ee0ec31d/versions'"), | ||
create_target("GET /wizard-api/questionnaire-importers/suggestions", "GET","url = '/wizard-api/questionnaire-importers/suggestions'"), | ||
] | ||
def create_targets_array(user): | ||
return [ | ||
create_target(user, "GET /wizard-api/configs/bootstrap", "GET", "url = '/wizard-api/configs/bootstrap'"), | ||
create_target(user, "GET /wizard-api/document-templates", "GET", "url = '/wizard-api/document-templates'"), | ||
create_target(user, "GET /wizard-api/document-templates/suggestions", "GET","url = '/wizard-api/document-templates/suggestions'"), | ||
create_target(user, "GET /wizard-api/document-templates/<id>", "GET","url LIKE '/wizard-api/document-templates/%' AND url != '/wizard-api/document-templates/suggestions'"), | ||
create_target(user, "GET /wizard-api/packages", "GET", "url = '/wizard-api/packages'"), | ||
create_target(user, "GET /wizard-api/packages/suggestions", "GET", "url = '/wizard-api/packages/suggestions'"), | ||
create_target(user, "GET /wizard-api/packages/<id>", "GET","url LIKE '/wizard-api/packages/%' AND url != '/wizard-api/packages/suggestions'"), | ||
create_target(user, "GET /wizard-api/questionnaires", "GET", "url = '/wizard-api/questionnaires'"), | ||
create_target(user, "GET /wizard-api/questionnaires/<id>", "GET",f"""url = '/wizard-api/questionnaires/{questionnaire_detail.QTN_UUID}'"""), | ||
create_target(user, "GET /wizard-api/questionnaires/<id>/comments", "GET",f"""url = '/wizard-api/questionnaires/{questionnaire_detail_comments.QTN_UUID}?path={questionnaire_detail_comments.PATH}'"""), | ||
create_target(user, "GET /wizard-api/questionnaires/<id>/documents", "GET",f"""url = '/wizard-api/questionnaires/{questionnaire_detail_documents.QTN_UUID}'"""), | ||
create_target(user, "GET /wizard-api/questionnaires/<id>/events", "GET",f"""url = '/wizard-api/questionnaires/{questionnaire_detail_events.QTN_UUID}'"""), | ||
create_target(user, "GET /wizard-api/questionnaires/<id>/questionnaire", "GET",f"""url = '/wizard-api/questionnaires/{questionnaire_detail_questionnaire.QTN_UUID}'"""), | ||
create_target(user, "GET /wizard-api/questionnaires/<id>/report", "GET",f"""url = '/wizard-api/questionnaires/{questionnaire_detail_report.QTN_UUID}'"""), | ||
create_target(user, "GET /wizard-api/questionnaires/<id>/settings", "GET",f"""url = '/wizard-api/questionnaires/{questionnaire_detail_settings.QTN_UUID}'"""), | ||
create_target(user, "GET /wizard-api/questionnaires/<id>/versions", "GET",f"""url = '/wizard-api/questionnaires/{questionnaire_detail_versions.QTN_UUID}'"""), | ||
create_target(user, "GET /wizard-api/questionnaires/project-tags/suggestions", "GET","url = '/wizard-api/questionnaires/project-tags/suggestions'"), | ||
create_target(user, "GET /wizard-api/questionnaire-importers/suggestions", "GET","url = '/wizard-api/questionnaire-importers/suggestions'"), | ||
create_target(user, "GET /wizard-api/usage", "GET", "url = '/wizard-api/usage'"), | ||
create_target(user, "GET /wizard-api/users", "GET", "url LIKE '/wizard-api/users%' AND url != '/wizard-api/users/suggestions'"), | ||
create_target(user, "GET /wizard-api/users/suggestions", "GET","url = '/wizard-api/users/suggestions'"), | ||
] | ||
|
||
fast_targets = ','.join(fast_targets_array) | ||
slow_targets = ','.join(slow_targets_array) | ||
|
||
dashboard = create_dashboard(fast_targets, slow_targets) | ||
panels = [ | ||
(20, ','.join(create_targets_array(20))), | ||
(40, ','.join(create_targets_array(40))), | ||
(80, ','.join(create_targets_array(80))), | ||
(160, ','.join(create_targets_array(160))), | ||
] | ||
|
||
dashboard = create_dashboard(panels) | ||
subprocess.run("pbcopy", text=True, input=dashboard) |
Oops, something went wrong.