Skip to content

Commit

Permalink
Merge pull request #254 from atlassian/release/3.0.0
Browse files Browse the repository at this point in the history
Release 3.0.0
  • Loading branch information
ometelytsia committed Jun 25, 2020
2 parents 26cba68 + da4b728 commit a6789ce
Show file tree
Hide file tree
Showing 78 changed files with 5,150 additions and 1,738 deletions.
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default code owners for master branch - Atlassian Data Center App Performance Toolkit
* @benmagro @ometelytsia @jkim2-atlassian @SergeyMoroz0703 @astashys @mmizin
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ All the changes are welcome. Please help us to improve code, examples and docume

Pull requests, issues and comments are welcome. For pull requests:

- Create your own fork of the repository and raise a pull request targeting master branch in the main repository
- Create your own fork of the repository and raise a pull request targeting `dev` branch in the main repository
- Separate unrelated changes into multiple pull requests

See the [existing issues](https://ecosystem.atlassian.net/projects/DAPT/issues) for things to start contributing.
Expand All @@ -31,5 +31,5 @@ link below to digitally sign the CLA. The Corporate CLA is for those who are
contributing as a member of an organization and the individual CLA is for
those contributing as an individual.

* [CLA for corporate contributors](https://na2.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=e1c17c66-ca4d-4aab-a953-2c231af4a20b)
* [CLA for individuals](https://na2.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=3f94fbdc-2fbe-46ac-b14c-5d152700ae5d)
* [CLA for corporate contributors](https://opensource.atlassian.com/corporate)
* [CLA for individuals](https://opensource.atlassian.com/individual)
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# name: atlassain/dcapt
# working dir: dc-app-performance-toolkit
# build: docker build -t atlassain/dcapt .
# bzt run: docker run --shm-size=4g -v "$PWD:/dc-app-performance-toolkit" atlassian/dcapt jira.yml
# interactive run: docker run -it --entrypoint="/bin/bash" -v "$PWD:/dc-app-performance-toolkit" atlassian/dcapt

FROM blazemeter/taurus

ENV APT_INSTALL="apt-get -y install --no-install-recommends"

RUN apt-get -y update \
&& $APT_INSTALL vim git openssh-server python3.8-dev python3-pip google-chrome-stable \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1 \
&& python -m pip install --upgrade pip \
&& python -m pip install --upgrade setuptools \
&& apt-get clean

COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt

RUN rm -rf /root/.bzt/jmeter-taurus/

WORKDIR /dc-app-performance-toolkit/app

ENTRYPOINT ["bzt", "-o", "modules.console.disable=true"]
30 changes: 16 additions & 14 deletions app/bitbucket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,35 @@ settings:
env:
application_hostname: test_bitbucket_instance.atlassian.com # Bitbucket DC hostname without protocol and port e.g. test-bitbucket.atlassian.com or localhost
application_protocol: http # http or https
application_port: 80 # 80, 443, 8080, 2990, etc
application_postfix: # e.g. /bitbucket in case of url like http://localhost:2990/bitbucket
application_port: 80 # 80, 443, 8080, 7990 etc
application_postfix: # e.g. /bitbucket in case of url like http://localhost:7990/bitbucket
admin_login: admin
admin_password: admin
concurrency: 20
load_executor: jmeter # only jmeter executor is supported
concurrency: 20 # number of concurrent virtual users for jmeter scenario
test_duration: 50m
ramp-up: 10m # time to spin all concurrent users
total_actions_per_hour: 32700
WEBDRIVER_VISIBLE: False
JMETER_VERSION: 5.2.1
allow_analytics: Yes # Allow sending basic run analytics to Atlassian. These analytics help us to understand how the tool is being used and help us to continue to invest in this tooling. For more details please see our README.
services:
- module: shellexec
prepare:
- python util/environment_checker.py
- python util/git_client_check.py
- python util/data_preparation/bitbucket/prepare-data.py
- python util/pre_run/environment_checker.py
- python util/pre_run/git_client_check.py
- python util/data_preparation/bitbucket_prepare_data.py
shutdown:
- python util/jmeter_post_check.py
- python util/post_run/jmeter_post_check.py
- python util/jtl_convertor/jtls-to-csv.py kpi.jtl selenium.jtl
post-process:
- python util/analytics.py bitbucket
- python util/cleanup_results_dir.py
- python util/analytics/analytics.py bitbucket
- python util/post_run/cleanup_results_dir.py
execution:
- scenario: jmeter
- scenario: ${load_executor}
concurrency: ${concurrency}
hold-for: ${test_duration}
ramp-up: 10m
ramp-up: ${ramp-up}
- scenario: selenium
executor: selenium
runner: pytest
Expand All @@ -48,7 +51,7 @@ scenarios:
application_protocol: ${application_protocol}
application_port: ${application_port}
application_postfix: ${application_postfix}
total_actions_per_hr: 32700
total_actions_per_hr: ${total_actions_per_hour}
tmp_dir: /tmp
ssh_key_url: https://centaurus-datasets.s3.us-east-2.amazonaws.com/bitbucket/ssh/id_rsa
modules:
Expand All @@ -73,15 +76,14 @@ modules:
- jpgc-tst=2.4
- jpgc-wsc=0.3
- tilln-sshmon=1.0
- jpgc-cmd=2.2
- jpgc-synthesis=2.2
system-properties:
server.rmi.ssl.disable: true
java.rmi.server.hostname: localhost
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "80.0.3987.106" # Supports Chrome version 80. You can refer to http://chromedriver.chromium.org/downloads
version: "83.0.4103.39" # Supports Chrome version 83. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
67 changes: 42 additions & 25 deletions app/confluence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,56 @@ settings:
env:
application_hostname: test_confluence_instance.atlassian.com # Confluence DC hostname without protocol and port e.g. test-jira.atlassian.com or localhost
application_protocol: http # http or https
application_port: 80 # 80, 443, 8080, 2990, etc
application_postfix: # e.g. /jira in case of url like http://localhost:2990/jira
application_port: 80 # 80, 443, 8080, 1990, etc
application_postfix: # e.g. /confluence in case of url like http://localhost:1990/confluence
admin_login: admin
admin_password: admin
concurrency: 200
load_executor: jmeter # jmeter and locust are supported. jmeter by default.
concurrency: 200 # number of concurrent virtual users for jmeter or locust scenario
test_duration: 45m
ramp-up: 3m # time to spin all concurrent users
total_actions_per_hour: 20000
WEBDRIVER_VISIBLE: False
JMETER_VERSION: 5.2.1
allow_analytics: Yes # Allow sending basic run analytics to Atlassian. These analytics help us to understand how the tool is being used and help us to continue to invest in this tooling. For more details please see our README.
# Action percentage for Jmeter and Locust load executors
view_page: 54
view_dashboard: 6
view_blog: 8
search_cql: 7
create_blog: 3
create_and_edit_page: 6
comment_page: 5
view_attachment: 3
upload_attachment: 5
like_page: 3
standalone_extension: 0 # By default disabled
services:
- module: shellexec
prepare:
- python util/environment_checker.py
- python util/data_preparation/confluence/prepare-data.py
- python util/pre_run/environment_checker.py
- python util/data_preparation/confluence_prepare_data.py
shutdown:
- python util/jmeter_post_check.py
- python util/post_run/jmeter_post_check.py
- python util/jtl_convertor/jtls-to-csv.py kpi.jtl selenium.jtl
post-process:
- python util/analytics.py confluence
- python util/cleanup_results_dir.py
- python util/analytics/analytics.py confluence
- python util/post_run/cleanup_results_dir.py
execution:
- scenario: jmeter
- scenario: ${load_executor}
executor: ${load_executor}
concurrency: ${concurrency}
hold-for: ${test_duration}
ramp-up: 3m
ramp-up: ${ramp-up}
- scenario: selenium
executor: selenium
runner: pytest
hold-for: ${test_duration}
scenarios:
selenium:
script: selenium_ui/confluence-ui.py
script: selenium_ui/confluence_ui.py
locust:
script: locustio/confluence/locustfile.py
jmeter:
script: jmeter/confluence.jmx
properties:
Expand All @@ -46,18 +64,18 @@ scenarios:
application_port: ${application_port}
application_postfix: ${application_postfix}
# Workload model
total_actions_per_hr: 20000
perc_view_page: 54
perc_view_dashboard: 6
perc_view_blog: 8
perc_search_cql: 7
perc_create_blog: 3
perc_create_and_edit_page: 6
perc_comment_page: 5
perc_view_attachment: 3
perc_upload_attachment: 5
perc_like_page: 3
perc_standalone_extension: 0 # By default disabled
total_actions_per_hr: ${total_actions_per_hour}
perc_view_page: ${view_page}
perc_view_dashboard: ${view_dashboard}
perc_view_blog: ${view_blog}
perc_search_cql: ${search_cql}
perc_create_blog: ${create_blog}
perc_create_and_edit_page: ${create_and_edit_page}
perc_comment_page: ${comment_page}
perc_view_attachment: ${view_attachment}
perc_upload_attachment: ${upload_attachment}
perc_like_page: ${like_page}
perc_standalone_extension: ${standalone_extension}
modules:
consolidator:
rtimes-len: 0 # CONFSRVDEV-7631 reduce sampling
Expand All @@ -80,15 +98,14 @@ modules:
- jpgc-tst=2.4
- jpgc-wsc=0.3
- tilln-sshmon=1.0
- jpgc-cmd=2.2
- jpgc-synthesis=2.2
system-properties:
server.rmi.ssl.disable: true
java.rmi.server.hostname: localhost
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "80.0.3987.106" # Supports Chrome version 80. You can refer to http://chromedriver.chromium.org/downloads
version: "83.0.4103.39" # Supports Chrome version 83. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
1 change: 1 addition & 0 deletions app/datasets/jira/examples/projects.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ABC,10000
28 changes: 14 additions & 14 deletions app/extension/bitbucket/extension_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
from selenium_ui.base_page import BasePage


def custom_action(webdriver, datasets):
def app_specific_action(webdriver, datasets):
page = BasePage(webdriver)
@print_timing
def measure(webdriver, interaction):
@print_timing
def measure(webdriver, interaction):
page.go_to_url(f"{BITBUCKET_SETTINGS.server_url}/plugin/report")
page.wait_until_visible((By.ID, 'report_app_element_id'), interaction)

measure(webdriver, 'selenium_app_custom_action:view_report')
@print_timing("selenium_app_custom_action")
def measure():

@print_timing
def measure(webdriver, interaction):
page.go_to_url(f"{BITBUCKET_SETTINGS.server_url}/plugin/dashboard")
page.wait_until_visible((By.ID, 'dashboard_app_element_id'), interaction)
@print_timing("selenium_app_custom_action:view_report")
def sub_measure():
page.go_to_url(f"{BITBUCKET_SETTINGS.server_url}/plugin/report")
page.wait_until_visible((By.ID, 'report_app_element_id'))
sub_measure()

measure(webdriver, 'selenium_app_custom_action:view_dashboard')
measure(webdriver, 'selenium_app_custom_action')
@print_timing("selenium_app_custom_action:view_dashboard")
def sub_measure():
page.go_to_url(f"{BITBUCKET_SETTINGS.server_url}/plugin/dashboard")
page.wait_until_visible((By.ID, 'dashboard_app_element_id'))
sub_measure()
measure()
28 changes: 28 additions & 0 deletions app/extension/confluence/extension_locust.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import re
from locustio.common_utils import init_logger, confluence_measure

logger = init_logger(app_type='confluence')


@confluence_measure
def app_specific_action(locust):

r = locust.client.get('/plugin/report') # navigate to page

content = r.content.decode('utf-8') # parse page content
token_pattern_example = '"token":"(.+?)"'
id_pattern_example = '"id":"(.+?)"'
token = re.findall(token_pattern_example, content) # parse variables from response using regexp
id = re.findall(id_pattern_example, content)
logger.locust_info(f'token: {token}, id: {id}') # logger for debug when verbose is true in confluence.yml file
if 'assertion string' not in content:
logger.error(f"'assertion string' was not found in {content}")
assert 'assertion string' in content # assertion after GET request

body = {"id": id, "token": token} # include parsed variables to POST body
headers = {'content-type': 'application/json'}
r = locust.client.post('/plugin/post/endpoint', body, headers) # send some POST request
content = r.content.decode('utf-8')
if 'assertion string after successful post request' not in content:
logger.error(f"'assertion string after successful post request' was not found in {content}")
assert 'assertion string after successful post request' in content # assertion after POST request
28 changes: 14 additions & 14 deletions app/extension/confluence/extension_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
from selenium_ui.base_page import BasePage


def custom_action(webdriver, datasets):
def app_specific_action(webdriver, datasets):
page = BasePage(webdriver)
@print_timing
def measure(webdriver, interaction):
@print_timing
def measure(webdriver, interaction):
page.go_to_url(f"{CONFLUENCE_SETTINGS.server_url}/plugin/report")
page.wait_until_visible((By.ID, 'report_app_element_id'), interaction)

measure(webdriver, 'selenium_app_custom_action:view_report')
@print_timing("selenium_app_custom_action")
def measure():

@print_timing
def measure(webdriver, interaction):
page.go_to_url(f"{CONFLUENCE_SETTINGS.server_url}/plugin/dashboard")
page.wait_until_visible((By.ID, 'dashboard_app_element_id'), interaction)
@print_timing("selenium_app_custom_action:view_report")
def sub_measure():
page.go_to_url(f"{CONFLUENCE_SETTINGS.server_url}/plugin/report")
page.wait_until_visible((By.ID, 'report_app_element_id'))
sub_measure()

measure(webdriver, 'selenium_app_custom_action:view_dashboard')
measure(webdriver, 'selenium_app_custom_action')
@print_timing("selenium_app_custom_action:view_dashboard")
def sub_measure():
page.go_to_url(f"{CONFLUENCE_SETTINGS.server_url}/plugin/dashboard")
page.wait_until_visible((By.ID, 'dashboard_app_element_id'))
sub_measure()
measure()
6 changes: 3 additions & 3 deletions app/extension/jira/examples/drawio/extension_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def custom_action(webdriver, datasets):
# Click more
webdriver.find_element_by_id('opsbar-operations_more').click()

@print_timing
def measure(webdriver, interaction):
@print_timing("selenium_open_drawio_editor")
def measure():
# Click to add a diagram (opens the drawio editor)
webdriver.find_element_by_id('drawio-add-menu-item').click()
WebDriverWait(webdriver, timeout).until(ec.frame_to_be_available_and_switch_to_it((By.ID, 'drawioEditor')))
measure(webdriver, 'selenium_open_drawio_editor')
measure()
27 changes: 27 additions & 0 deletions app/extension/jira/extension_locust.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import re
from locustio.common_utils import init_logger, jira_measure

logger = init_logger(app_type='jira')


@jira_measure
def app_specific_action(locust):
r = locust.client.get('/plugin/report') # navigate to page

content = r.content.decode('utf-8') # parse page content
token_pattern_example = '"token":"(.+?)"'
id_pattern_example = '"id":"(.+?)"'
token = re.findall(token_pattern_example, content) # parse variables from response using regexp
id = re.findall(id_pattern_example, content)
logger.locust_info(f'token: {token}, id: {id}') # logger for debug when verbose is true in jira.yml file
if 'assertion string' not in content:
logger.error(f"'assertion string' was not found in {content}")
assert 'assertion string' in content # assertion after GET request

body = {"id": id, "token": token} # include parsed variables to POST body
headers = {'content-type': 'application/json'}
r = locust.client.post('/plugin/post/endpoint', body, headers) # send some POST request
content = r.content.decode('utf-8')
if 'assertion string after successful post request' not in content:
logger.error(f"'assertion string after successful post request' was not found in {content}")
assert 'assertion string after successful post request' in content # assertion after POST request
Loading

0 comments on commit a6789ce

Please sign in to comment.