Load Testing Atlassian Jira, Confluence, Bitbucket Part 2

Here here you can read part 1 of this article.
In Part 2, we will talk about how to prepare data for stress testing using the dc-app-performance-toolkit tool  .

Preparing test data


There are two ways to prepare test data:

  • Use backups provided by Atlassian. You can use this option if, for example, you are writing your own plugin and it does not matter to you what data this plugin will work on.
  • Use your own data. This option will come in handy if you have your own copy of Jira, Confluence or Bitbucket, which you modify using standard functionality, scripts, plugins, and other possible methods.

Backups Atlassian


Atlassian provides backups for Jira, Confluence and Bitbucket, which can be used for load testing.

In order to install these backups, you need to go to the app-dc-performance-toolkit / app / util / jira folder if you are testing Jira,  app-dc-performance-toolkit / app / util / confluence if you are testing Confluence or  app-dc-performance-toolkit / app / util / bitbucket if you are testing Bitbucket.

These folders contain the files that you need to run to install Atlassian backups. Here are the descriptions of these files:

  • index-sync.sh ( Jira Confluence) – atlassian-jira.log (atlassian-confluence.log) β€œindexes – 100%”. , . , , Jira/Confluence. , , , , , , .
  • populate_db.sh – Postgres Jira/Confluence/Bitbucket.
  • upload_attachments.sh – data.
  • index-snapshot.sh ( Confluence) – , .

All of the above scripts must be run on the same virtual machine on which the instance you are about to test is installed. Since these scripts are run from the same virtual machine, they will independently determine the version of your instance and download the database dump and attachments for your version.

Well, what if you do not want to use Postgres? After all, populate_db.sh works only for the Postgres database.

In this case, only for Jira you can download the xml backup and restore it using the standard Jira functionality . Here is a link to this backup: https://centaurus-datasets.s3.amazonaws.com/jira/$ {Jira_Verson} /large/xml_backup.zip - supported versions of Jira 8.0.3, 7.13.6, 8.5.0.

Atlassian did not prepare xml backups for Confluence and Bitbucket. You need to use the script populate_db.sh or prepare the data yourself, which I will discuss later in the section β€œUsing our own data”.

We use our own data.


If you want to test your instance on your own data, then this is also possible. All you need is to make sure that your data can be used by the dc-app-performance-toolkit tool.

When dc-app-performance-toolkit starts testing, Taurus runs the prepare-data.py script, which selects data from which you will be testing from your instance. As a result, several csv files with data from your instance are created.

If prepare-data.py cannot select the necessary data, then testing will fail. Therefore, you need to make sure that the necessary data is in your copy.

To understand what data should be, you need to study the prepare-data.py file for the product that you are going to test.

Let's examine these files.

Jira


The prepare-data.py file   for Jira is located in the  dc-app-performance-toolkit / blob / master / app / util / data_preparation / jira / folder .

This script selects data from Jira and creates the following files:

  • issues.csv - a list of ish.
  • jqls.csv - list of jql queries.
  • kanban-boards.scv - list of kanban panels.
  • project-keys.csv - list of project keys.
  • scrum-boards.csv- list of scrum panels.
  • users.scv - list of users.

We will not study the prepare-data.py file completely, we just need to look at this method:

def __create_data_set(jira_api):
    dataset = dict()
    dataset[USERS] = __get_users(jira_api)
    software_project_keys = __get_software_project_keys(jira_api, PROJECTS_COUNT_LIMIT)
    dataset[PROJECT_KEYS] = software_project_keys
    dataset[ISSUES] = __get_issues(jira_api, software_project_keys)
    dataset[SCRUM_BOARDS] = __get_boards(jira_api, 'scrum')
    dataset[KANBAN_BOARDS] = __get_boards(jira_api, 'kanban')
    dataset[JQLS] = __generate_jqls(count=150)

    return dataset

As you can see in this method, all the data that is needed during testing is selected:

dataset[USERS] = __get_users(jira_api)

We select users from our Jira instance. The username must begin with β€œperformance_”. We have to select as many users as we have set as concurrent users in the concurrency parameter in the jira.yml file . If no such user is found or their number is insufficient, then users will be created. Users will have the prefix β€œperformance_” and password password.

software_project_keys = __get_software_project_keys(jira_api, PROJECTS_COUNT_LIMIT)
dataset[PROJECT_KEYS] = software_project_keys

We select project keys of type Software.

__get_issues(jira_api, software_project_keys)

We select no more than 8000 software from software projects that are not in Closed status.

dataset[SCRUM_BOARDS] = __get_boards(jira_api, 'scrum')

We select no more than 250 pan panels.

dataset[KANBAN_BOARDS] = __get_boards(jira_api, 'kanban')

We select no more than 250 kanban panels.

dataset[JQLS] = __generate_jqls(count=150)

We generate jql queries with the following content: 'text ~ β€œabc *” ”.

Thus, in order for the tests to run without errors, you need to ensure the availability of Software projects with ish and scrum and kanban boards. If you already have these objects in your instance, then you don’t need to do anything (testing will be successful without any changes), if not, then you need to create the missing objects.

Since my Jira instance is empty, I created the Scrum Software Development and Kanban Software Development projects and ran the load test again:

bzt jira.yml

This time the script completed without errors. Here is the script output:

18:15:24 INFO: Taurus CLI Tool v1.14.0
18:15:24 INFO: Starting with configs: ['jira.yml']
18:15:24 INFO: Configuring...
18:15:24 INFO: Artifacts dir: /Users/alexm/PycharmProjects/easymigration/dc-app-performance-toolkit/app/results/jira/2020-05-02_18-15-24
18:15:24 INFO: Preparing...
18:15:25 INFO: Starting shell command: python util/environment_checker.py
18:15:25 INFO: Starting shell command: python util/data_preparation/jira/prepare-data.py
18:15:26 WARNING: There is newer version of Taurus 1.14.2 available, consider upgrading. What's new: http://gettaurus.org/docs/Changelog/
18:15:28 INFO: Will install JMeter into /Users/alexm/.bzt/jmeter-taurus/5.2.1
18:15:28 INFO: Downloading: https://apache-mirror.rbc.ru/pub/apache//jmeter/binaries/apache-jmeter-5.2.1.zip
100% [===========================================================] Time: 0:00:04
18:15:33 INFO: Unzipping /var/folders/4r/w8hkd4w51x787tw4ynb29v2w0000gn/T/tmp9g5rzqs1.zip to /Users/alexm/.bzt/jmeter-taurus/5.2.1
18:15:50 INFO: Downloading jmeter-plugins-manager-1.3.jar from https://search.maven.org/remotecontent?filepath=kg/apc/jmeter-plugins-manager/1.3/jmeter-plugins-manager-1.3.jar
18:15:51 INFO: Downloading cmdrunner-2.2.jar from https://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/2.2/cmdrunner-2.2.jar
100% [===========================================================] Time: 0:00:01
18:15:52 INFO: Installing JMeter plugins: jpgc-casutg,jpgc-dummy,jpgc-ffw,jpgc-fifo,jpgc-functions,jpgc-json,jpgc-perfmon,jpgc-prmctl,jpgc-tst,bzm-parallel=0.4,bzm-random-csv=0.6,jpgc-casutg=2.5,jpgc-dummy=0.2,jpgc-ffw=2.0,jpgc-fifo=0.2,jpgc-functions=2.1,jpgc-json=2.6,jpgc-perfmon=2.1,jpgc-prmctl=0.4,jpgc-tst=2.4,jpgc-wsc=0.3,tilln-sshmon=1.0,jpgc-cmd=2.2,jpgc-synthesis=2.2
18:16:38 INFO: 1 obsolete CookieManagers are found and fixed
18:16:56 INFO: Installing ChromeDriver...
18:16:56 INFO: Will install ChromeDriver into /Users/alexm/.bzt/selenium-taurus/tools/chromedriver/80.0.3987.106
18:16:56 INFO: Downloading: https://chromedriver.storage.googleapis.com/80.0.3987.106/chromedriver_mac64.zip
100% [===========================================================] Time: 0:00:01
18:16:57 INFO: Unzipping /var/folders/4r/w8hkd4w51x787tw4ynb29v2w0000gn/T/tmpurpp_7tz.zip to /Users/alexm/.bzt/selenium-taurus/tools/chromedriver/80.0.3987.106
18:16:57 INFO: Installing GeckoDriver...
18:16:57 INFO: Will install GeckoDriver into /Users/alexm/.bzt/selenium-taurus/tools/geckodriver/0.23.0
18:16:57 INFO: Downloading: https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-macos.tar.gz
100% [===========================================================] Time: 0:00:02
18:17:00 INFO: Untaring /var/folders/4r/w8hkd4w51x787tw4ynb29v2w0000gn/T/tmpiurqzzt4.zip to /Users/alexm/.bzt/selenium-taurus/tools/geckodriver/0.23.0
18:17:00 WARNING: You are using Python 3, make sure that your scripts are able to run in Python 3
18:17:00 INFO: Starting...
18:17:00 INFO: Waiting for results...
18:17:00 INFO: Waiting for finish...
18:17:00 ERROR: Console screen failure: ord() expected string of length 1, but int found
18:25:22 WARNING: Please wait for graceful shutdown...
18:25:22 INFO: Shutting down...
18:25:22 INFO: Starting shell command: python util/jmeter_post_check.py
18:25:22 INFO: Starting shell command: python util/jtl_convertor/jtls-to-csv.py kpi.jtl selenium.jtl
18:25:59 INFO: Post-processing...
18:25:59 INFO: Test duration: 0:08:22
18:25:59 INFO: Samples count: 3272, 0.06% failures
18:25:59 INFO: Average times: total 0.595, latency 0.000, connect 0.000
18:25:59 INFO: Percentiles:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Percentile, % β”‚ Resp. Time, s β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
18:25:59 INFO: Request label stats:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ label                                 β”‚ status β”‚    succ β”‚ avg_rt β”‚ error                                                                                                                                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ jmeter_browse_boards                  β”‚   OK   β”‚ 100.00% β”‚  0.186 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_browse_projects                β”‚   OK   β”‚ 100.00% β”‚  0.149 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_create_issue                   β”‚   OK   β”‚ 100.00% β”‚  0.135 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_login_and_view_dashboard       β”‚   OK   β”‚ 100.00% β”‚  0.497 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_open_comment                   β”‚   OK   β”‚ 100.00% β”‚  0.210 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_open_editor                    β”‚   OK   β”‚ 100.00% β”‚  0.287 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_open_quick_create              β”‚   OK   β”‚ 100.00% β”‚  0.063 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_save_comment                   β”‚   OK   β”‚ 100.00% β”‚  0.521 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_save_edit                      β”‚   OK   β”‚ 100.00% β”‚  0.900 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_search_jql                     β”‚   OK   β”‚ 100.00% β”‚  0.610 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_view_backlog                   β”‚   OK   β”‚ 100.00% β”‚  0.387 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_view_dashboard                 β”‚   OK   β”‚ 100.00% β”‚  0.267 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_view_issue                     β”‚   OK   β”‚ 100.00% β”‚  0.593 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_view_kanban_board              β”‚   OK   β”‚ 100.00% β”‚  0.344 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_view_project_summary           β”‚   OK   β”‚ 100.00% β”‚  0.611 β”‚                                                                                                                                                 β”‚
β”‚ jmeter_view_scrum_board               β”‚   OK   β”‚ 100.00% β”‚  0.347 β”‚                                                                                                                                                 β”‚
β”‚ selenium_a_login                      β”‚   OK   β”‚ 100.00% β”‚ 28.460 β”‚                                                                                                                                                 β”‚
β”‚ selenium_browse_boards_list           β”‚   OK   β”‚ 100.00% β”‚  9.871 β”‚                                                                                                                                                 β”‚
β”‚ selenium_browse_projects_list         β”‚   OK   β”‚ 100.00% β”‚  6.376 β”‚                                                                                                                                                 β”‚
β”‚ selenium_create_issue                 β”‚   OK   β”‚ 100.00% β”‚  5.143 β”‚                                                                                                                                                 β”‚
β”‚ selenium_edit_issue                   β”‚   OK   β”‚ 100.00% β”‚ 16.305 β”‚                                                                                                                                                 β”‚
β”‚ selenium_save_comment                 β”‚   OK   β”‚ 100.00% β”‚ 19.909 β”‚                                                                                                                                                 β”‚
β”‚ selenium_search_jql                   β”‚   OK   β”‚ 100.00% β”‚ 32.249 β”‚                                                                                                                                  β”‚
β”‚ selenium_view_backlog_for_scrum_board β”‚   OK   β”‚ 100.00% β”‚ 14.223 β”‚                                                                                                                                                 β”‚
β”‚ selenium_view_dashboard               β”‚   OK   β”‚ 100.00% β”‚ 13.805 β”‚                                                                                                                                                 β”‚
β”‚ selenium_view_issue                   β”‚   OK   β”‚ 100.00% β”‚ 12.332 β”‚                                                                                                                                                 β”‚
β”‚ selenium_view_kanban_board            β”‚   OK   β”‚ 100.00% β”‚ 14.675 β”‚                                                                                                                                                 β”‚
β”‚ selenium_view_project_summary         β”‚   OK   β”‚ 100.00% β”‚ 12.710 β”‚                                                                                                                                                 β”‚
β”‚ selenium_view_scrum_board             β”‚   OK   β”‚ 100.00% β”‚ 14.893 β”‚                                                                                                                                                 β”‚
β”‚ selenium_z_log_out                    β”‚   OK   β”‚ 100.00% β”‚ 14.889 β”‚                                                                                                                                                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
18:26:00 INFO: Writing JUnit XML report into: /Users/alexm/PycharmProjects/easymigration/dc-app-performance-toolkit/app/results/jira/2020-05-02_18-15-24/xunit.xml
18:26:00 INFO: Starting shell command: python util/analytics.py jira
18:26:06 INFO: Starting shell command: python util/cleanup_results_dir.py
18:26:06 INFO: Artifacts dir: /Users/alexm/PycharmProjects/easymigration/dc-app-performance-toolkit/app/results/jira/2020-05-02_18-15-24
18:26:06 INFO: Done performing with code: 0

It can be seen from the script output that Taurus launched the prepare-data.py file and created the following csv files:

issues.csv

KAN-1,10023,KAN
KAN-2,10024,KAN
KAN-3,10025,KAN
KAN-4,10026,KAN
KAN-5,10027,KAN
...........


jqls.csv

text ~ "vqz*" order by key
text ~ "fpl*" order by key
text ~ "zjs*" order by key
text ~ "wph*" order by key
text ~ "xhx*" order by key
text ~ "pxt*" order by key
text ~ "deh*" order by key
text ~ "iri*" order by key
text ~ "jbr*" order by key
text ~ "snt*" order by key
...........

kanban-boards.csv

2

project_keys.csv

KAN
SCRUM

scrum-boards.csv

1

users.csv

performance_kqgdayqwfj,password
performance_zyqnwihaxr,password
performance_onfxfovior,password
performance_rrujzwrxlt,password
performance_agjbcxxeqy,password

Then Taurus installed JMeter and the Chrome web driver, ran the tests, and printed the result.

Now let's look at the prepare-data.py file for Confluence and Bitbucket.

Confluence


Consider the prepare-data.py file   for Confluence.

Here is the main method:

def __create_data_set(rest_client, rpc_client):
    dataset = dict()
    dataset[USERS] = __get_users(rest_client, rpc_client, CONFLUENCE_SETTINGS.concurrency)
    dataset[PAGES] = __get_pages(rest_client, 5000)
    dataset[BLOGS] = __get_blogs(rest_client, 5000)
    return dataset

 dataset[USERS] = __get_users(rest_client, rpc_client, CONFLUENCE_SETTINGS.concurrency)

We select or create users for load testing according to the same logic as in the case for Jira.

dataset[PAGES] = __get_pages(rest_client, 5000)

We select pages from Confluence using the following cql: β€œtype = page and title! ~ JMeter and title! ~ Selenium and title! ~ Home”.

dataset[BLOGS] = __get_blogs(rest_client, 5000)

We select blogs from Confluence by the following cql: β€œtype = blogpost and title! ~ Performance”.

Thus, in order to start testing for Confluence you need to have pages and blogs in your copy.

Bitbucket


Now look at the prepare-data.py file   for Bitbucket.

Here is the main function:

def __create_data_set(bitbucket_api):
    dataset = dict()
    dataset[USERS] = __get_users(bitbucket_api)
    dataset[PROJECTS] = __get_projects(bitbucket_api)
    dataset[REPOS] = __get_repos(bitbucket_api)
    dataset[PULL_REQUESTS] = __get_prs(bitbucket_api)
    return dataset

dataset[USERS] = __get_users(bitbucket_api)

We select or create users according to the same logic as for Jira, but this time users should have the β€œdcapt-perf-user” prefix. And when creating the user, the password is equal to the username.

dataset[PROJECTS] = __get_projects(bitbucket_api)

We select projects.

dataset[REPOS] = __get_repos(bitbucket_api)

We select repositories.

dataset[PULL_REQUESTS] = __get_prs(bitbucket_api)

We select the request pool. The number of request pools must be no less than the concurrency parameter in the bitbucket.yml file  .

Thus, in order to run tests for Bitbucket, you need to have in your instance projects, repositories and a pool of requets in an amount no less than the concurrency parameter in the bitbucket.yml file.

So, we looked at how to prepare data for load testing using backups prepared by Atlassian, and how to run load testing on our data. In the next part, we will talk about what artifacts are created after stress testing, what information they provide and what kind of graphics we can generate from the box.

All Articles