How to exploit all commands in Magento 2 CLI (Part 5)

In this article we going to discuss about how to exploit all commands in Magento 2 CLI(Part 5)

Part 5: Produce sample data for performance testing

Everyone knows Magento 2 has a powerful command-line interface tools (CLI). It permits you to complete task including installation, configuration, database backups, compiling LESS etc. Here I will show you how to Produce sample data for performance testing using command-line in Magento 2. Before starting this guide please,refer our previous guidelines

Here are the following steps shows you how to exploit all commands in Magento 2 CLI:

Step 1:  Magento recital Toolkit

Step 2: dash the data generator

Magento recital Toolkit

  • Magento 2 has provided the recital toolkit which aids us to produce sample data for testing performance. It places at [Magento_folder]/setup/recital toolkit. You must view the README.txt in recital toolkit for more information.
  • There are four profile in recital toolkit which is used to produce different data size: small,medium,large and extra large. You can see configuration files of these profiles in folder/setup/recital toolkit/profiles/ce.
  • The following are part of small profile XML configuration file:
<?xml version="1.0"?>

<!--

/**

 * Copyright © 2016 Magento. All rights reserved.

 * See COPYING.txt for license details.

 */

-->

<config>

    <profile>

        <websites>1</websites> <!-- Number of websites to generate -->

        <store_groups>1</store_groups> <!--Number of stores-->

        <store_views>1</store_views> <!-- Number of store views -->

        <simple_products>800</simple_products> <!-- Simple products count -->

        <configurable_products>50</configurable_products> <!--Configurable products count (each configurable has 3 simple products as options, that are not displayed individually in catalog) -->

        <categories>30</categories> <!-- Number of categories to generate -->

        <categories_nesting_level>3</categories_nesting_level> <!-- Nesting level for categories -->

        <catalog_price_rules>10</catalog_price_rules> <!-- Number os catalog price rules -->

        <cart_price_rules>10</cart_price_rules> <!-- Number of cart price rules -->

        <cart_price_rules_floor>2</cart_price_rules_floor> <!-- The price rule condition: minimum products amount in shopping cart for price rule to be applied -->

        <customers>20</customers> <!-- Number of customers to generate -->

        <tax_rates_file>tax_rates.csv</tax_rates_file> <!-- Tax rates file in fixtures directory-->

        <orders>80</orders> <!-- Orders count -->

...

    </profile>

</config>
DataSmall profileMedium profileLarge profileExtra-Large profile
Websites1135
Store_groups1235
Store_views1235
Simple_products80016000400000800000
Configurable_products5010002500050000
Categories3030010003000
Categories_nesting_level3336
Catalog_price_rules102050100
Cart_price_rules102050100
Cart_price_rules_floor2225
Customers2020020005000
Tax_rates40000400004000040000
orders8016004000080000

The above mentioned table describes you the size of sample data to produce in configuration file of profile. The below table show you the data size of all profiles.

Dash the data generator

  • The following command to produce testing data

php bin/magento setup:perf:produce-fixtures {path to profile}

  • Produce data using large profile
php bin/magento setup:perf:produce-fixtures setup/performance-toolkit
  • The output will be
Producing profile with following parameters:

|- Websites: 3

 |- Store Groups: 3

 |- Store Views: 3

 |- Categories: 1,000

 |- Simple products: 400,000

|- Configurable products: 1,000

 |- Customers: 2,000

 |- Cart Price Rules: 50

 |- Catalog Price Rules: 50

|- Orders: 40,000

Producing Websites, stores and store view… done in <time>

Producing categories… done in <time>

Producing simple product … done in <time>

Producing configurable EAV variations... Done in <time>

… More….

The following steps which help you to Exploit all commands in Magento 2 CLI(Part 5)


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *