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>
Data Small profile Medium profile Large profile Extra-Large profile
Websites 1 1 3 5
Store_groups 1 2 3 5
Store_views 1 2 3 5
Simple_products 800 16000 400000 800000
Configurable_products 50 1000 25000 50000
Categories 30 300 1000 3000
Categories_nesting_level 3 3 3 6
Catalog_price_rules 10 20 50 100
Cart_price_rules 10 20 50 100
Cart_price_rules_floor 2 2 2 5
Customers 20 200 2000 5000
Tax_rates 40000 40000 40000 40000
orders 80 1600 40000 80000

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)

Last Update: April 9, 2018  

February 12, 2018   164   Nandini R    Start With Magento 2    
Total 2 Votes:
0

Tell us how can we improve this post?

+ = Verify Human or Spambot ?

Leave a Reply

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

Facebook
Google+
http://www.webnexs.com/blog/kb/exploit-all-commands-magento-2-cli-2
Twitter
LinkedIn